Reputation: 103
After upgrade my xcode to 7 I am getting the issue in autolayout. I have put a container in view controller for which I set the leading and the equals width to parent view (it means that I need container on full width of screen) every thing has working fine but the issue is with the leading constraint of that container. I have to set the leading constraint constant to -20 then it would be looks perfect on 6plus, but for all other devices -16 would do the same result.
Upvotes: 0
Views: 247
Reputation: 3396
The most easiest way is to resolve your issue is by going to your Storyboard scene or nib file click on topmost view in hierarchy and finally click on Resolve auto layout Issues button from the four option available at bottom right corner and update frames.
Xcode will take care of rest.
This is happening because from Xcode 7 iOS 9, Apple wants us to leave leading or trailing space at-least by 20 points for UI perspective.
Upvotes: 1
Reputation: 21
I think it would be easier to add spacing constraints from your container to the super view. If you define Leading Space, Trailing Space, Top Space, and Bottom Space as "0" without margin the container should have the exact size of your device regardless of the iOs version and device type.
Upvotes: 0