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? - ios

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

Related

Creating auto layouts for iphone se?

I'm making an app that I want applicable to all sizes but the problem is that iPhone 8 up to iPad devices are good but I noticed that the iPhone SE and below iPhones are not being supported when you make your app for iPhone 8 and up because it's so small. Now does that mean I have to create a scroll view for all my pages not since it doesn't fit for iPhone SE and below or is it recommended to not just include iphone se size and below for any future app?
It's recommended to create your app to be universal and support all screen sizes to hit users from the market as much as you can , regrading support for IPhone 4 , 5 I think you need to have a scrollView in any screen that you think it may exceed screen height for these 2 devices , or create items height in proportional to screen height to guarantee that all UI elements will fit in the screen

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.

ios swift - UI Designer Adaptive iPhone Layout

I've disabled size classes in my project and have 3 view controllers.
By looking at the preview of each of the view controllers, I've noticed that the iPhone 6 which is the one I've been running the application on shows a layout completely different than how it looks when you run it on the actual phone.
I'm trying to build an application with size classes disabled that will have an adaptive layout between iPhones. I was under the impression that size classes was geared towards adaptivity between iPhone and iPad applications?
My app looks good on the iPhone 6 and terrible on the 6 plus. I would like the layout to be adaptive between both iPhones. Any advice?
Thank you
PS: Using autolayout
First of all enable Size classes. This is how you can vary the changes for 6 and 6+. If you want the similar layout on both the devices then use 600x600 size. If you want different layout in 6 and 6+ then you have to switch the size class and change the constraints accordingly. Refer this link for tutorial: https://www.raywenderlich.com/113768/adaptive-layout-tutorial-in-ios-9-getting-started

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.

UI doesn't fill in iPhone 6 plus

I'm working on an iOS app and realize the ui is not auto stretch to fit the screen when it's running in iPhone 6 plus.
So the UI is on the right left, and there are a lot of white space in the bottom and right.
If I set the width of a view to beyond 320 (ex. 400), then the view be wider than 320.
How could I make my views auto stretch to fill the screen?
I have a few other apps, and they works perfectly fine in iPhone 6 plus.
I couldn't figure out what make this app's ui not auto stretching.
The only difference I could think of it this one is create after the official xcode 6 is released, the others were created in xcode 6 beta version
Thanks!
Seems like you enabled native resolution for iPhone 6 Plus. If you delete "launch screen file" you can individually control which screen size will be supported as native resolution by adding related size of launch images.
You should start using auto-layouts. Start from here: Auto layout guide

Resources