Adaptive UI interface in iOS 8 through iphone 5 to iphone 6+

192 Views Asked by At

I have created an app which runs on different devices, but when i set everything in interface builder, it looks like despite of constraints, the labels or buttons are positioned differently in different devices in the simulator. i.e.: i have an interface i designed, i use it as background image view in the interface builder, using iphone 5 size as reference. in this image i designed a field, when i put a label in it, it looks in different position in the simulated iphone 5 and iphone 6, even though it has been constrained in the same way. what am i doing wrong? thx so much for your help!!!

ps: i am assuming the image view sizes are proportional between iphone 5 and 6, so they should naturally have the same aspect ratio hence will the label constraints

2

There are 2 best solutions below

1
On

I think the easiest way to explain setting constraints between different view sizes with Autolayout is to watch how it's done. Here's an excellent video from Stanford University's CS193P iOS development course explaining how it works.

Here you'll find resources for the course. You can also download full lectures from iTunesU.

0
On

I've watched both the Stanford video and this video, https://www.youtube.com/watch?v=LSV6VcGdXPc

Both were helpful, but I found the video by Mitchell Hudson to be much more useful.