1

I have an abundant amount of Automatic Preferred Max Layout Width is not available on iOS versions prior to 8.0 warnings in my project in ~80 xib files. I have attempted to fix these warnings using answers found here: Automatic Preferred Max Layout Width is not available on iOS versions prior to 8.0, but this led to AutoLayout issues. Fixing all the consequential effects is not something our team wants to take on, and furthermore QA. I know how to turn off all warnings for xib files in a target. How do I ignore this specific warning?

Community
  • 1
  • 1
Tom Howard
  • 4,672
  • 2
  • 43
  • 48

2 Answers2

7

Find all the multi-line UILabels in your project (Lines = 0 in Attributes Inspector) and set their Preferred Width property in Size Inspector to 0 (check the Explicit check box).

Amy
  • 301
  • 2
  • 9
  • It can be something like that you have only 1 warning but you need to make 5 changes to make it disappear. – superarts.org Oct 13 '15 at 11:15
  • 1
    Wow, great tip. Checking the Explicit box indeed does the trick! Just a few notes: multi-line UILabels are not only defined by Lines being set to 0, but instead 0 or any number greater than 1 (e.g. 2 in some cases for me), and when you check the Explicit box the Preferred Width property may not necessarily become 0 (e.g. in my case it picked up the correct values from my layout constraints, which often meant it become 320, or smaller values in other cases). -- Again, thanks so much for this tip! – Erik van der Neut Nov 12 '15 at 23:37
0

Check the label constrain, the answer was to click on the constraint, and then look in the Utilities bar (on the right). As shown in the picture below, click on an item and then make sure that "relative to margin" is unchecked.

enter image description here

Sonic
  • 518
  • 1
  • 7
  • 19