Xcode alignment / spacing between Storyboard and Simulator?

so my storyboard looks like this

enter image description here

But when I open the iOS simulator the item (playing card) turns off to the right

enter image description here

What's wrong with storyboard spacing / alignment?

(This is with the latest iOS 8 and XCode 6)

+3


source to share


3 answers


Select your ImageView gaming device and click the Align button in the Auto Layout bar.

Check the horizontal center in the container by setting it to 0 and click Add 1 Constraint.

enter image description here



Then press the Pin button and add the top distance to the nearest adjacent constraint 0, like so:

enter image description here

+4


source


Add constraints to make it horizontally centered in the view. This will be done.



See Apple doc it will help.

0


source


In this same example, I was literally looking for this problem. I finally figured it out.

Limit the size of the button first. Then with downward constraints: Align the center x to the middle x of the button. Align the center y to the middle of the y button. BINGO !! Thanks for your input. @Adrian Sluyters. I thought the Detail View was scalable, but the constraints just adjust where the center of the view is. Lesson learned.

See my post: Detail view on storyboard too zoomed - creates inconsistent objects in the simulator

0


source







All Articles