Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storyboard preview differs from simulator

I'm currently trying to grapple with constraints (using Xcode 6 GM seed). Using reset to suggested constraints, everything looks right in the universal storyboard and in the preview: storyboard

storyboard previews

As you can see, I'm previewing for multiple screen sizes. All of them have the image of the dot (and the image itself takes up the whole view, set to draw in the center) in the center. However, when I load it on the simulator, I see:

simulator

I'm not sure why this is happening. As far as I can tell, the constraints are all as they should be:

constraints

constraint_1constraint_2constraint_3constraint_4

Is there something I am doing? Or is there a bug here in xcode 6?

Thanks in advance!

like image 744
saward Avatar asked Sep 10 '14 06:09

saward


1 Answers

You don't need to add Leading, trailing, and vertical space constraints. To place your dot in center you need to add Horizontal and Vertical center in container constraint. Place your dot in the center of controller and add these two like in the given image. enter image description here

like image 98
Muhammad_Awaab Avatar answered Nov 04 '22 05:11

Muhammad_Awaab