iOS make universal app for iPhone 4 and 5 - ios

Quick question. For iOS in Xcode I want to make an app that looks good on the iPhone 5 and the iPhone 4. I am using story boards. All I know is when you click the button on the bottom of the storyboard page with the two arrows on both sides of an iPhone it changes the views of the app from 4 inch to 3.5 or vise versa. This usually makes it look messed up because if I made the app with an iPhone 5 screen it looks weird on the iPhone 4 screen. Preferably without using code and just using storyboards, how do I make an app that is universal for the iPhone 4 and the iPhone 5. Basically like making an app universal for the iPhone and iPad where there are 2 storyboards (one for the iPhone and one for the iPad) how do I do that for the iPhone 4 and iPhone 5 (one story board for the 4 inch screen and one for the 3.5 inch screen)?
Thank you

Use autolayouts to format your views.
Those arrows are only to simulate the view. They are not view holders.
Check: https://developer.apple.com/library/ios/documentation/userexperience/conceptual/AutolayoutPG/Introduction/Introduction.html

Related

iOS auto layout support for all iphones?

I'm using autolayout storyboards for my ios app which is only for iPhone. When I submit, Apple reject it saying that the app should support iPhone 3.5 inch for ipad view on iphone resolution but making the UI for iPhone 3.5 inch is bit hard.
If I change it to support iPhone 3.5 inch onwards it gives bad view for iphone 5 inch. The contents are not centric there's long space for iphone 5 inch. What are the solutions?
Can I configure the settings to support iPhone 4 onwards?
or else Can I make two storyboards for iPhone 3.5 inch & 5 inches?
Yes, you can make 2 storyboards and switch them, depending on screen height, but why you can't adjust constraints for all iPhones screens? Usually this is possible.
One way for complex layouts - create constraint outlets and change them in code.
Another way - divide design to smaller UIViews, that contains elements, like container and set constraints between them.

Xcode 6: Storyboards

I loved Xcode 4 when there was two storyboards, one for the iPhone and one for the iPad. There was only one screen size to which was the 3.5 inch which made the layout so much easier. Then Xcode 5 came along and it was different because the iPhone storyboard layout changed for the 3.5 inch screen and the 4 inch screen and it was quite difficult to use. Now Xcode 6 is here and I now only have one Storyboard. I hate it. I cannot get any of my iPhones buttons and labels to line up at all. iPhone 4 inch and 4.7 is fine, but the 3.5 is all off. I have tried all those tricks of resetting the suggested constraints too. So my question is, is there any way to have more than one storyboard? I would really like to have one for the iPhone 3.5 inch, another for the iPhone 4.0 inch, another for the 4.7 inch, one for the 5.5 inch and one for the iPad. I would also like them to all work fine and not interfere with each other and there layout. I am not worried if I have to do everything about 5 times but I would rater spend more time and get the layout correct. So if this is possible I would be extremely happy!
You could try loading the storyboard in your AppDelegate.
Described here: https://stackoverflow.com/a/12553838/866904
Create 2 storyboards and then just load the preferred one in your AppDelegate.

Autolayout for iphone 6 and iphone 6 plus

I have been try a good solution for this problem... I have an app and this work perfect in iphone 4, and iphone 5, But in iphone 6 and 6 plus i don't know how made a good solution with autolayout.
the problem is: my app is a clone of a home screen, and i need that all the icons have the same position in all devices
I don't know how to let the space between the icons flexible
iphone 4 and 5
for iphone 6 should look like, but if it works for one does not work in another
Thanks

How to create the UI for different devices in iOS? [duplicate]

This question already has an answer here:
Xcode5 ( 3.5" screen to 4 inch )
(1 answer)
Closed 8 years ago.
I'm working with an iOS application in which i uses the different controllers with 4 inch screen sizes.
I'm done with my application. Now it is the requirement that it also runs on the 3.5 inch screen like on iPhone 4S. I am using the auto layout. How can i do it?
This is my first application.So I have a little knowledge about UI.
My requirement is that when I run the same application on iPhone 4S with 3.5 inch screen size, it needs to be reset automatically with 3.5 inch.
Please help me out.
Use the iOS Simulator, that will give you an idea of how the application will turn out (Whilst you're in in choose Hardware -> Device -> iPhone Retina (3.5 inch).
You can adjust elements in interface builder to scale to different elements on the screen under the view tab. Try using the view tab (looks like a ruler) and specify the origin and scaling there.

How to use autolayout, to make compatible for iPhone 4 and iPhone 5 both?

I have custom upside tab bar and using storyboards. I have followed this tutorial custom tab bar
This tutorial explains about side tabBar and I am using upside tabBar with same approach. I am using autolayout and need to make compatible for iPhone 4 and iPhone 5 both. When I design in 4 inch screen, it runs good for iPhone 5 and for iPhone 4, it cuts bottom 88 pixels(difference in iPhone 4 and iPhone 5), and if I design for 3.5 inch screen, it is good for iPhone 4 and shows blank space for bottom 88 pixels.
Actually I am newbie for autolayout and how can I implement this for my project?
Thanks in advance for any help.
This is design for iPhone 5
but it looks like this, when runs on 3.5 inch screen

Resources