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

Tobias picture Tobias · Jan 20, 2015 · Viewed 8.1k times · Source

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. enter image description here

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

enter image description here

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 enter image description here As you can see it scales correctly but the aspect gets wrong compared to the iphone 6 version below scaling correctly. enter image description here

Here is an ipad version looking like the iphone 5s version scaling wrong. enter image description here

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!

Answer

Daniel Rinser picture Daniel Rinser · Jan 20, 2015

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).