iOS auto layout support for all iphones? - ios

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.

Related

How to let Xcode know which asset to use for the target iPhone?

I am designing an app for iOS in SWIFT. I have decided that the auto layout will be compact and will be only for iPhone in portrait mode. I wanted to clear up a few hiccups on designing buttons for the 2 different screen ratios: the first being the iPhone 4s and the second ratio being the iPhone 5 and above. Because the new iPhones have a taller height, does that mean I will need to design 2 different ratios of buttons, and if so, how do I use them in Xcode? For example here's the stock apple calculator;
link to picture: http://imgur.com/mkIBghD
As you can see the the buttons on the taller iPhone have a square shape. The buttons on the 4s are more stubby. What do I need to do in Xcode to let the app know which asset to use for the respective phone and how would I implement that in Auto Layout?
thanks
In order to do this you setup autolayout constraints. This will make the buttons change shape/size depending on the device. You do not need to have multiple assets because all the phones you are talking about have the same retina (2x) display.
You need to add three different sized images for a single Image Set in Images.xcassets . The sizes should be 1x for iPhone 4s, 2x for iPhone 6(It'll work for iPhone 5 too) and 3x for iPhone 6 plus.

How to set auto-scaling on an app (optimized for iPhone 6's 4.7 inch screen) to fit iPhone 5 and 4's screen?

I have seen old iOS apps auto-scale to fit iPhone 6/6+'s large screen on iOS 8. I have recently developed an app which is optimized to display on iPhone 6's 4.7 inch screen. Apply auto-layouts would be lots of work because a lot of views are created programmatically so I am wondering is it possible to make an app auto-scale to fit smaller screens?
Use auto layout in code
Refactor your code to support different screen sizes
Refactor your code to size views as percentage of screen size

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.

itunnes connect upload app only for 4 inch (iPhone 5, iPhone 5s)

Our binary was rejected, because the 3.5-inch iPhone does not display properly views. But we do not want to support 3.5 inches. Only the iPhone 5 and above.
How to disable 3.5 inches in itunnes connect ?
I believe it isn't possible to not support 3.5" devices. Your best bet would be to use Auto Layout and setup constraints to make everything resize automatically, it will also make your life easier for the new iPhone 6 & 6 Plus with different screen resolutions.
You should remove launch image for 3.5 inch if you want to support only iPhone 5 and above.

Bound iPhone App to 3.5 inch Frame in iPhone 5

Wrote an app for iPhone in 3.5 inch mode, and now - I need to make it work for iPhone 5 (4-inch retina).
I'm getting a little complicated with Auto-layouts and can't seem to make it work. Is there some way I can just bound the app to a 3.5 inch frame on an iPhone 5 in the middle of the screen (not with the ugly white space in the bottom I see now), and in that frame it would work like and iPhone 4?
I know it may not be the optimal solution, but I need to publish the app and for now it will do.
Thank
As the responses indicated - this should not be done.
I fought with the layouts until I made them fit 4 inch screens too. It's the only way to go.

Resources