Xcode 6 beta 7: storyboard adds extra space on the right and left sides

When I add a subview to the root view of the ViewController and with the leadingSpace, trailingSpace, topSpace and bottomSpace auto layout set to zero, extra spaces appear on the left and right sides (so if I print the frame of the subframes, it will be 16 and the size is 32 smaller. what should be). So in fact we get that the initial and final spaces are not zeros ...

enter image description here

As you can see in the picture, the leading space is zero, but origin.x = 16

I used to not work with auto layout, so my question is: Is this a new xCode or function error?

PS Updated all frames and restrictions.

+43
ios autolayout xcode6 storyboard uistoryboard
06 Sep '14 at 15:50
source share
1 answer

iOS 8 adds the concept of β€œcontent fields” to the UIView . The WWDC 2014 What's New in Cocoa Touch video discusses content fields (under the heading Adaptive Fields), starting at about 12 million 30 seconds.

The default is 8 points by default. Each end of the layout constraint may relate to the view field rather than the true edge of the view (use File> Open Quickly to go to the NSLayoutAttribute definition to see the possibilities).

Your restriction is "relative to the field." When you create a constraint using Add New Constraints, you can choose whether it relates relative or not:

constraint popover

It always matters margin-relative; you must turn off the check box every time you add constraints if you do not want them to be relative to the brand.

You cannot change whether the restriction is relative to the marker in quickly changing the screen of your screenshot. Instead, double-click the constraint to open the full attribute inspector. There you can use the pop-up menus to select for each end of the constraint, whether it is relative or not:

constraint-attributes

+119
Sep 06 '14 at 16:31
source share
β€” -



All Articles