Simulator for iPhone 8 plus off-center

Wondering if anyone has seen this problem. I've got a very simple app with a line of text and an image. Both are centered in the storyboard. But when I run the app in the iPhone 8 plus simulator, the text and image are off center slightly to the left. If I run the app in the iPhone 8 simulator it looks okay.


Is this a bug in the 8 plus simulator?

Accepted Answer

If you want the controls to be centered on any size device, you'll have to add constraints that center it. Otherwise they will just be placed at the same x and y coordinates (number of pixels from top left) on every device. Since the 8 Plus has more pixles, that will place it left of center. Select each item in the storyboard click the Align button (3rd button in bottom right corner; looks like a line with 2 rectangles to the right of it), and select Horizontally in Container. You'll probably want to set a y constraint too so Xcode doesn't complain about missing constraints. You can use the Add Constraints button (button that looks like a square with a sideways T on each side). Type a number in the top field (or click the red symbol under it to use the number that is already there).

Thank you!

Sjhshs

Simulator for iPhone 8 plus off-center
 
 
Q