-2

I am asking perhaps one of the easiest questions lol but just could not figure it out.

I have some view controllers created based on the screen size of iPhone 7, but when I change devices to iPhone 7plus and iPhoneSE, my labels and buttons were all misplaced...

I have uploaded what they look like in different devices, can somebody please help?

WhatItLooksLikeOniPhone7

WhatItLooksLikeOniPhoneSE

Andrew Qin
  • 67
  • 2
  • 11
  • You need to learn Autolayout and apply constraints on these buttons and labels to make them correct for various screen sizes. – Hemang Jul 02 '17 at 12:24
  • You must use auto layout its the easiest way to do that – Dekel Maman Jul 02 '17 at 12:44
  • Where's your source code? What are your layout constraints? There's no way to say what's wrong without knowing what you're doing now. – Ssswift Jul 02 '17 at 14:50

1 Answers1

0

To keep the UI elements at a defined place you need to something that will keep the elements at their position. And hence you need to use autolayout. Autolayout is basically a constraint based system which will layout the ui elements. There are many tutorials available.

Abhilasha
  • 76
  • 1
  • 5