S.S.D
S.S.D

Reputation: 1686

Xcode 9.2 - “Fixed Width Constraints May Cause Clipping” Warning

I am facing this problem for the constraints added to the labels in the storyboard. I have read to change the "fixed length" to ">=" or "<=". But what does ">=" or "<=" mean on Label constraints and which one should I use ?

Upvotes: 1

Views: 3523

Answers (1)

Priya
Priya

Reputation: 749

This warning says that if label got bigger text than rest of text will cut which does not fit in fixed width.

>= Means the width of the label will become flexible if label got bigger text; the minimum width will be the one you have set.

<= Means the maximum width of the label will be the one you set.

More convenient way to set label constraints is to set leading, trailing, top and bottom constraints instead of setting width constraint where, trailing space will have >= constraints with the value for minimum space required between parent view and label / horizontally near by view and label.

Hope this helps :)

Upvotes: 4

Related Questions