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

后端 未结 13 1122
失恋的感觉
失恋的感觉 2020-11-27 10:33

I downloaded the new Xcode and in Interface Builder I\'m having a ton of problems with warnings that say things like:

Fixed Width Constraints May Caus

13条回答
  •  失恋的感觉
    2020-11-27 11:20

    For labels and buttons which are localized this warning makes sense and you should provide the necessary constraints so your labels don't overlap. If they don't overlap now they might in the future, so it won't hurt to provide the constraints.

    Xcode helps you add these constraints automatically:

    In the document outline of your storyboard click on the yellow arrow and either choose "fixed leading" or "fixed trailing", depending on where the text is on your screen (left or right). This will fix it for most issues.

    If you have this issue with a Button without any text (only image), try to remove the "default title" which might still be set for the button:

提交回复
热议问题