Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Leading/Trailing space show as -16?

As I updated my Xcode from version 5 to 6 I saw a strange things in the storyboard. Here is one example:

  • What my requirement was - I wanted no space between my view and the container view.
  • What I did - I dragged the views left/right edge so that it meets the container margin. And then I put a horizontal spacing constraint.

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?

like image 232
Sarasranglt Avatar asked Feb 03 '15 05:02

Sarasranglt


People also ask

What does leading trailing spaces mean?

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.

How do I get rid of char 160 in Excel?

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.

How do you fix a trailing whitespace error?

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.


2 Answers

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.

enter image description here

If you have already created the constraint then you can select that constraint and uncheck Relative to margin

enter image description here

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.

like image 191
Inder Kumar Rathore Avatar answered Nov 15 '22 23:11

Inder Kumar Rathore


Try to uncheck "Relative to margin" enter image description here

like image 21
Artem Zaytsev Avatar answered Nov 16 '22 00:11

Artem Zaytsev