Xcode 9 – “Fixed Width Constraints May Cause Clipping” and Other Localization Warnings

I was getting the same warnings even without multiple languages in my app, which led me to find out what was really going on. . .

There are a few different things going on here. I was able to silence the fixed-width warnings in my own app by changing the width of the object spacings from fixed width to greater than or equal or less than or equal.

This can be done by selecting the object in interface builder, going to the size inspector and changing it there:


Or, select the constraint from the document outline, go to size inspector, and change it there:



As far as the warning at the top of your screenshot:

Fixed leading and trailing constraints with a center constraint may cause clipping

Here is a screenshot from my own app in which I was getting the exact same warning:

I had the label with the @ sign set to leading and trailing to the buttons but also to align the center with the rating label. Once I removed the center alignment constraint, the warning disappeared, but I was left with an improperly laid out set of objects.

It is then that I resigned myself to embrace the Stack View. As annoying as it is to use, when you get all of the constraints and settings right, it lays out beautifully and with no warnings.


Edit

As Repose writes in the comments, sometimes simply adding >= 0 will be what you need, as you are making sure two elements do not overlap.

Leave a Comment