0

I haven't been using XCode for a while (in fact, since 4.0). Today, I tried placing some elements, let's say, in the example - three centered labels. I remember it usually centered for all devices universally (iPad, iPhone 4, iPhone 5 etc). But now it seems to mess up.

I have noticed that I can change the Simulated Metrics Size to "4 inch" for example, and it solves it just for the iPhone 5/5S. But I want my application to fit universally, and I remember I did it before.

Is there any setting that I'm missing?

Here's an example:

(1) The storyboard placement and Simulated Metrics settings in my XCode, perfectly centered labe https://i.stack.imgur.com/Z7jpR.png

(2) The final result, simulated on an iPhone 5 (same goes for my personal iPhone 5S device): https://i.stack.imgur.com/9lUc3.png

Thanks in advance!

Ariel Weinberger
  • 2,195
  • 4
  • 23
  • 49

1 Answers1

0

Try using auto layout. Set the width, height, leading alignment and center x alignment for each label. Your constraints should look something like this...

enter image description here

And then it will show in the simulator like this...

enter image description here

Brett DiDonato
  • 1,794
  • 1
  • 10
  • 9