Search code examples
iphoneios7ios8autolayout

Auto Layout Top is not working well with 10px space at top


I'm building iphone app. I use auto-layout. Please check following images.

enter image description here enter image description here

As you can see, the top space is set as 0px. but in running, the top space is 10px.

I want to fix this issue asap. P.S. it is same on iOS7 & iOS8. Thanks,


Solution

  • Go to constraint->edit. Set both First Item and Second item to .top. And make sure it's not Relative to margin.