What does the "automatically adjusts font requires using a dynamic type text style" warning mean?

IosSwiftStoryboardXcode8

Ios Problem Overview


I am getting the following warning:

> "automatically adjusts font requires using a dynamic type text style"

Screenshot added

Which I can not get rid of the warning is on main.storyboard.

I have checked every UILabel in the Identity Inspector to make sure the "Automatically Adjusts Font" is unchecked.

Ios Solutions


Solution 1 - Ios

  1. Open your storyboard as Source Code
  2. Search for key "adjustsFontForContentSizeCategory"
  3. Check which object has this option and uncheck Dynamic Type checkbox from interface builder.

Solution 2 - Ios

I just changed Text style to Body & Warning vanishes.

It's Just because it is dynamic type textStyle

See list of predefined supported dynamic type textStyle -

enter image description here

Solution 3 - Ios

I had the same problem. Even after I opened the storyboard as source and removed the "adjustsFontForContentSizeCategory" key, saved and cleaned the project it would still show.

So then I:

  1. Cleaned the project
  2. Closed Xcode
  3. Deleted the derived data folder contents
  4. Re-Opened Xcode and rebuilt

It was gone. :)

Solution 4 - Ios

It seems to have been a bug in Xcode. This is what I did to fix it:

  1. Change the font in the label that showed the error, to a dynamic type, as suggested
  2. Select check box for "Automatically Adjusts Font"
  3. Build and run the project (the error disappears)
  4. Uncheck the "Automatically Adjusts Font" box
  5. Change the font back to the previous setting that caused the error
  6. Rebuild the project

The error is still gone.

Solution 5 - Ios

If the "Automatically adjusts font" box is checked with a non dynamic font this warning will appear. Either uncheck the box on the offending label or use a dynamic font type.

enter image description here

Solution 6 - Ios

  1. Open your storyboard, right click storyboard in file navigator.

enter image description here

  1. Search for (command F) and delete instances of adjustsFontForContentSizeCategory="YES"

Solution 7 - Ios

In the Storyboard, after uncheck every "Automatically Adjusts Font" in the Attributes Inspector, run shift + command + K and then build your project again. This should clean your project and remove the warning.

Solution 8 - Ios

Swift 5+, Xcode 11+:

  1. Right-Click the storyboard that's having this issue (Check Issue Navigator if you don't know which)

  2. Go to the Open As option and select Source Code

  3. Replace every adjustsFontSizeToFit="NO" with adjustsFontSizeToFit="YES"

  4. Run your application

  5. Watch the warning go away (And even if you undo step 3)

Solution 9 - Ios

I got this error for automatic adjusting on a button. But I could not find "Automatic Adjust Font" checkbox on right panel. Get rid of warning by going to source code of .storyboard and deleting "adjustsFontForContentSizeCategory" properties on problematic button solved my problem.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionK. LawView Question on Stackoverflow
Solution 1 - IosayalcinView Answer on Stackoverflow
Solution 2 - IosJackView Answer on Stackoverflow
Solution 3 - IosSpillyView Answer on Stackoverflow
Solution 4 - IosK. LawView Answer on Stackoverflow
Solution 5 - IosDonovan KingView Answer on Stackoverflow
Solution 6 - IosScottyBladesView Answer on Stackoverflow
Solution 7 - IosArkamerView Answer on Stackoverflow
Solution 8 - IosGerardo B.View Answer on Stackoverflow
Solution 9 - IosYunus GedikView Answer on Stackoverflow