What does the "automatically adjusts font requires using a dynamic type text style" warning mean?
IosSwiftStoryboardXcode8Ios Problem Overview
Ios Solutions
Solution 1 - Ios
- Open your storyboard as Source Code
- Search for key "adjustsFontForContentSizeCategory"
- 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 -
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:
- Cleaned the project
- Closed Xcode
- Deleted the derived data folder contents
- 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:
- Change the font in the label that showed the error, to a dynamic type, as suggested
- Select check box for "Automatically Adjusts Font"
- Build and run the project (the error disappears)
- Uncheck the "Automatically Adjusts Font" box
- Change the font back to the previous setting that caused the error
- 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.
Solution 6 - Ios
- Open your storyboard, right click storyboard in file navigator.
- 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+:
-
Right-Click the storyboard that's having this issue (Check Issue Navigator if you don't know which)
-
Go to the Open As option and select Source Code
-
Replace every adjustsFontSizeToFit="NO" with adjustsFontSizeToFit="YES"
-
Run your application
-
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.