Resize app designed for Iphone 6 to scale correctly in iphone 5s - ios

Ok, here is the problem I have designed an application for iphone 6 screen without size classes and autolayout.
Looking like below in the storyboard. As you can see its simulated size is 4.7 inch.
It works perfectly when running on iphone 6 devices obviusly.
However when trying to run the app in other devices than iphone 6 it wont scale proportional.
My hope was that if I removed the lanuch screen images only keeping the iphone 6 size it would scale to fit other screens looking the same as if it where run on a iphone 6 only scaled up or down depenging on device.
My launch screen looks like this now
It does infact scale the app but it scales the app in wrong proportion making it looked chopped like this.
Iphone 5s version of the app looks like this
As you can see it scales correctly but the aspect gets wrong compared to the iphone 6 version below scaling correctly.
Here is an ipad version looking like the iphone 5s version scaling wrong.
It seems to me that the scaling works since I have removed all launch images except the 4.7 display (iphone 6) The problem however seems to be that it scales keeping the aspect of an iphone 5 in width making the iphone 6 display to wide.
I have tried to add launch images for all devices but the problem then is that I need to use autolayout and size classes to make it work.
Is there any way to for instance tell the scaling to keep aspect but use iphone 6 width and height intact without using size classes etc.
To make the question even more simple. Is there any way to scale an app made for strictly iphone 6 so resize to iphone 5s/ipad?
Any help is highly appreciated!

Well, the "trick" with removing the other launch images doesn't work, as you noticed yourself.. This automatic scaling only works from 4" to 4.7" and 5.5" and is only to support older apps on the new devices, not for general purpose "I am too lazy to support all sizes" use cases.. ;-) Apart from that, you should definitely support the native resolutions.
So, to answer your question: You can either just use Auto Layout. This is definitely the preferred approach - after all that's exactly the use case that it has been built for.
Alternatively, if you really don't want to or can't use Auto Layout, you either need to make sure to set your auto resizing masks correctly (e.g. "flexible width" on the stuff that needs to grow/shrink horizontally etc.), or adapt your frames manually in code (which partially defeats the purpose of IB).

If you didn't use Auto-Layout or Size Classes, your only hope is to programmatically change the positions/size of each element individually in the viewDidAppear or viewDidLayoutSubviews method of your LoginViewController. You would have to do it also on orientation change (if your app supports it).
It's a lot of work that can be easily be avoided by using Auto-Layout/Size Classes!

Related

Can iPhone SE design work for iPhone X

I have designed my app without auto layout and for the size 320*568 (iPhone SE). The design i did for iPhone SE itself worked up to iPhone 7plus bcoz of adding corresponding launch image. Even it now works for iPhone 8 plus. But for iPhone X, it doesn't seem to be appearing full screen(Pl find the below image). Is there a quick fix or do i have to use autolayout to get it right?
Autolayout is the best for the iOS design to make it responsive according to the different device, so it is suggested to use autolayout. There are some reasons for why we should use the autolayout ?
It assures that it looks fine on all the devices.
It requires less effort to make design responsive if you are looking for different sizes or orientation.
It is easy to update the design when there is new device introduced.
And for particularly your question. If you want great design on all the device including iPhone X you should use 'Safe Area' + 'Autolayout'.

Removing launch screen file from Info.plist scales the views

I noticed something that when you remove the launch screen file entry from the XCode Info.plist file, any view of any view controller becomes scaled according to the screen size, so the views appear zoomed in on large screen sizes such as the iPad Pro (12.9 inches) and appear somehow zoomed out on smaller devices (iPad Pro 9.7 inches).
In that case it seems that the Auto Layout constraints have no effect as the scaling is done automatically.
I really can't understand what does this has to do with the layout constraints, so I appreciate if any one can explain what's the reason for that.
Without being able to provide deep details, iOS uses the launch screen definition (view or static images) to determine which size classes the app should use. If you have not supplied those, it seems you get scaling that you generally do not want.
That doesn't mean auto-layout no longer has any affect... it just means that the auto-layout engine is not using the current screen size for its size/positioning calculations.
You'll see very similar results if you explicitly set your project for iPhone only.
Simple, obvious solution: Don't remove the launch screen.
Yes this is expected behaviour... Same is for iPhone 6 Plus. If you remove the iPhone 6 Plus launch screen, it will display the iPhone 6 scaled version.
This is just for backward compatibility. If your app is not ready for iPad Pro or iPhone 6+, scaled version can be used by removing the respective splashing screens.
All current iPhone apps or iPad apps in AppStore those are not optimised runs as a scaled version.

How to efficiently use Autolayut and Auto-Resizing in same target?

I have one target. It's a login based application. Because of legacy code, I am forced to use Auto-Resizing in some View Controllers whereas I have updated newer UI using Auto-Layout.
If the Autolayout has to work on iPhone 6 and 7 (4.7"/5.5" screens) I have to add the launch images for these.
PROBLEM:
All my screen that are not using auto layout gets disturbed when I add the Launch image.
If I don't use the launch screen images, all the View that use auto layout are scaled up and appears slightly bigger than expected.
I do not have the luxury to update the legacy code to use auto layout.
Can someone please give me an alternative or a work around.?
If I don't use the launch screen images, all the View that use auto layout are scaled up and appears slightly bigger than expected
Correct. This is because, without the launch screen, your app is no longer compatible with devices like the iPhone 6 and 6 Plus. To compensate, the app is treated as if this were an iPhone 5 and is shown in zoomed mode.
So if you want to run at native resolution / size on iPhone 6 and later, you must have the launch screen. That being so, setting up your interface to deal with the larger size is up to you. You do not have to adopt auto layout; autoresizing still works fine. (However, using auto layout would be better.)

Views in storyboard do not resize properly on iPhone 6

I've checked a lot of different websites and stackoverflow answers, and I'm still stuck.
I developed an app for iPhone and iPad targeting iOS 7.1. I have two storyboards, one for each device. The app only displays in portrait mode. I cannot seem to get the app to display full screen on the iPhone 6 simulator.
I've tried numerous things, I followed the advice linked here by adding a Launch Screen, setting the iPhone storyboard to auto layout and "use size classes", and . Not only does that not affect the size, but the Launch Screen doesn't seem to scale properly either. If I get it to fit the iPhone 6 it doesn't fit the iPhone 5 properly.
I've tried adding the proper launch images and I don't get any errors saying the wrong image resolution is present.
I've used the storyboard as a Launch Screen described here.
Now, when I switched to "use size classes" I could manually extend the objects in the views to match up with the size of iPhone 6 (I have not tested it for 6s) but that makes it extend past the iPhone 5 boundaries. The only thing I can think of right now is to create another storyboard and detect if it's iPhone 6, but I would really like some other ideas.
Here's what it looks like for iPhone 6:
And here's what it looks like on iPhone 5:
Best advice i can give u is
Use default size class , the classic 600x600 and then use Auto Layout
Or do the reverse, take a 3.5inch size VC and apply Auto Layout on it. Everything will present itself quite perfectly if you can apply the right constraints
Here is a link for an awesome Autolayout tutorial

Resize UI to fit iphone 6/6+ without using auto-layout

I am building an ios app and I have been developing it on iphone 5 size class. I have done it this way because I have not yet learned how to use auto-layout. I was wondering if there was a way(other than auto-layout) that I can use, on this app so that the view fits perfectly in iphone 5/5c/5s and 6/6+
Without auto-layout the available solutions will be pretty rough. Because your lengths are all hard values-- you will have to manually manipulate them to achieve the size you want in an iPhone 6. It would definitely still be slightly more time consuming to apply auto-layout constraints onto all of your views-- but you would be safe from having to do this again in the future. Hopefully you don't have too many views :)

Resources