Make iOS app compatible on iPhone 4,5,6,6 Plus - ios

I have developed an app for iPhone 5. But when I run it on iPhone 4, lower part is not visible, and when I run it on iPhone 6/6 Plus, it shows only on a part of display, leaving other part white. (Which is logical actually).
So my question is - what should I do to make my iPhone 5 app, to scale up or down depending on device it is install on. Or in other words, how to make it compatible with iPhone 4, 6/6 Plus?
Thank you.

You should look into Adaptive layout features in storyboard.
It helps you place your views according to different sizes and helps you set different sizes for different resolutions.
You can find a helpful tutorial here. Adaptive layout

There is many ways to handle different screen sizes.
The preferred (iOS6 and later) is Auto Layouts
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/Introduction/Introduction.html

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

Supporting all iphone sizes

I'm trying to create a iOS app, but I'm stuck on the layout.
I created the home view, but now I see that it's not shown in the right way in the 4S simulator.
I tried with size classes, but it looks like 4S and 6, for example, are in the same size class, and so I can't set a different dimension for views.
My goal is to support all devices, also iPads. Can someone please tell me how to do it?
Size classes mostly used for separation between ipad, apple watch and landscape modes.In potrait mode iphone 4 to iphone 6 all phone device sizes are in same class(regular height and compact width).Autolayout has many different constraints to help you to fit interfaces in same class.You should consider horizontaly/verticaly align, equal width and aspect ratio constraints.They are so flexible for smaller size changes and help you to design adaptive layout.
You should use "Reset to Suggested Constraints" for all views in your View controller. You can also check the simulated metrics for all devices without compiling the the code.
For 4s and 6 by default the size is Inferred. You should try resetting the constraints to check this for iPad as well.
I am just sharing an idea
Option1:
I think You can try adaptive Layouts and in file inspector->simulated Metrics->size-> Inferred. It works in all devices it supports both landscape and Portrait.
Option2: Go for Visual layouts they are easy to understand and they work perfect in all modes of Portrait.
I am think that you use code Instead design in main.storyboard !
for ex: create button with code
(and use Ratio in your code)
by this way i create small app for iPhone & iPad
!

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

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!

Supporting multiple iPhone resolutions with a single storyboard

We all are going to update our apps to iphone 6 and iphone 6 plus. That means we need to support 4 sizes.
1.) 3.5
2.) 4
3.) 4.7
4.) 5.5
Can we support all these screen sizes with single xib or storyboard ? also please share your views on how we can update our existing apps for iphone 6 and iphone 6 plus.
Yes. See Apple's iOS8 documentation specifically, size classes:
iOS 8 makes dealing with screen size and orientation much more versatile. It is easier than ever to create a single interface for your app that works well on both iPad and iPhone, adjusting to orientation changes and different screen sizes as needed. Design apps with a common interface and then customize them for different size classes. Adapt your user interface to the strengths of each form factor. You no longer need to create a specific iPad storyboard; instead target the appropriate size classes and tune your interface for the best experience.
There are two types of size classes in iOS 8: regular and compact. A regular size class denotes either a large amount of screen space, such as on an iPad, or a commonly adopted paradigm that provides the illusion of a large amount of screen space, such as scrolling on an iPhone. Every device is defined by a size class, both vertically and horizontally.
There is also a very good tutorial video on the WWDC site.
In order to stop your iPhone 6/6+ app being scaled, add a launch image of the correct size or better, use a launch storyboard.
From there you should use AutoLayout and avoid hard coding to screen sizes. In the long run it'll be a lot less effort and less error prone.
In existing projects you can use autoresizing or auto layout of xib files.. that support all 4 devices.
I have implement my projects using autoresizing to support all devices.

Will iPad2 app work on iPad3?

I am new to iOS,
I seen that iPad 2 has resolution of 1024-by-768 and iPad 3 has resolution of 2048-by-1536 with retina display..
I am sure that iPad 2 app will defiantly work on iPad mini because the resolution is same..
and same case for iPhone,
Do we need to develop separate app for iPhone 5 ? because it has resolution different then other iPhone..
I am sure this is a dumb question that any mildly experienced iOS developer would laugh at but since a simple Google search didn't turn anything up I figured id ask.
Any help will be appriciated.
Will iPad2 app work on iPad3?
Yes, it will. The iPad 3 has exactly twice the pixel density in each direction as the iPad 2, so the OS will just go ahead and "scale up" the graphics (except those which are made from images in the app - you'll have to generate a higher resolution version of these image files for iPad 3).
Do we need to develop separate app for iPhone 5?
Not a separate app, you just have to pay attention to the different screen aspect ratio. If you don't do that, you'll have black bars at the top and the bottom of the screen.
iPhone 4 Apps will work on iPhone 5 :
But it will have black spaces at top and bottom, In order to refactor it you just need to change the splash screen which is suitable for iphone 5.
iPad 2 Apps on iPad3:
It will work without any issues unless they have different iOS versions running in them.
As far as I know, the difference between the iPad2 and iPad3 won't be such a big problem. (unless you want to be really exact)
Whereas you should develop a new App for the iPhone5 because it has a greatly different screen format than the iPads.
Yes, your iPad 2 working app will work on iPad 3 (also, depends on iOS version). Just it will not look good :) In order to make it look good, for all images used for your app, you have to add #2x ones with double size.
As for iPhone 5, no, you don't have to develop different app, just you have to make your views resizable to fit on screen. Good Luck!

Resources