As I updated my Xcode from version 5 to 6 I saw a strange things in the storyboard. Here is one example:
Earlier the value used to be - Leading/Trailing Space to:Superview Equals:0
Now after updating to Xcode 6 it always shows - Leading/Trailing Space to:Superview Equals:-16.000000
Why does this happen?
A leading space is a space that is located before the first character (letter, number, punctuation mark) in a text entry field. A trailing space is a space that is located after the final character in a text entry field.
The trick is to combine TRIM() with a few more functions. We start by using SUBSTITUTE() to replace all instances of CHAR(160) (non-breaking space) with normal space characters. We also use the CLEAN() function which attempts to remove characters that simply wouldn't display on your machine in the first place.
Use your editor to find the end of the line and backspace. Many modern text editors can also automatically remove trailing whitespace from the end of the line, for example every time you save a file. In emacs: C-M-% <space> + $ then press return twice.
That's container's margin. I think it applies the default margin to the edges. If you want to set up the Leading/Trailing Space to Superview
constraint then you can do so.
If you have already created the constraint then you can select that constraint and uncheck Relative to margin
Please note the Relative to margin
feature is only available on iOS >= 8
, the app will crash (not sure but it should) on iOS < 8
.
Try to uncheck "Relative to margin"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With