Search code examples
iosiphoneapp-storeiphone-5iphone-6

Create app on iPhone 5&4S after creating app on iPhone6


I have created an app for iPhone 6. I can launch it on an iPhone 5 or 4S, but since the screen is smaller, I have some design issues. For example I user a UITableViewCell, and each RowHeight equals 560. I also have four square buttons equaly repartited horizontally.

When I launch my app on an iPhone 5/4S, the cell takes more than the size of the screen (and I need the cell size to be smaller or equal the size of the screen). Using Editor -> pin, etc I have managed to keep my 4 buttons equally repartited horizontally, but consequently they are not square buttons any more...

How can I solve that issue? The purpose is then to publish this app on the App Store, so I am wondering how can I do to have a cool app on each iPhone...

Thank You!!


Solution

  • You need to use constraints and use 600x600 devices in Storyboard. Then distribute your elements in each view and then select all of them and use "Add missing constraints" so it will adapt in each device.

    Here you can do it for each element or for the entire view. I recommend you to do it element by element cause if you do it for the entire view maybe you face some problems, but its ok, you need to try and catch ;D

    enter image description here

    Then if you want to control the sizes you need to add size constraints control+leftClick and drag to the same element, you will be allowed to add Height or Width constraint.

    enter image description here

    Maybe you need to setup some constraints manually, but you will learn how to do it really fast, just some views and you will get it.

    Hope this helps.