3
votes

I have made an app and it works really great on iPhone simulator 4 inch screen. But, when I run it on the iPhone 3.5 inch screen, it cuts the bottom of my app

How can I optimize my app to the 3.5 inch screens?

(note :I am using storyboards)

2
You will need to activate Autolayouts mode.Sophy Swicz

2 Answers

4
votes

Open your storyboard, then select one of the view controllers. Change the size of the screen to 3.5" as shown here:

enter image description here

Make sure your views are laid out correctly. You may either use Auto Layout or, if you're not using it, check the view sizes, and the springs and struts:

enter image description here

Here, you want to make sure that you don't hardcode the view height to 4", or doing anything similar. After you make the fixes, you can switch back to the 4" size, to make sure the views are still laid out. Repeat for all your view controllers in your storyboard, until done.

If your code updates the UI (e.g. by adding/positioning/animating views), you also need to make sure you're not hardcoding any view's frame with the assumption that the screen is 4".

2
votes

First option is to use autolayouts. Second option is to set your views scale properly.

by clicking on a button i selected, you can see how will your layout look on different screen sizes

Storyboard screenshot

Now, you select a view you want to set-up, and play with this option here, marked on the picture below

this screenshot