What does the "automatically adjusts font requires using a dynamic type text style" warning mean?
Solution 1
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 2
- 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 3
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 4
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 5
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.
K. Law
Updated on November 25, 2021Comments
-
K. Law over 2 years
I am getting the following warning:
"automatically adjusts font requires using a dynamic type text style"
Which I can not get rid of the warning is on
main.storyboard
.I have checked every
UILabel
in theIdentity Inspector
to make sure the "Automatically Adjusts Font" is unchecked. -
Josh almost 7 yearsI agree. Double and triple checked my files and even checked XML/source - it was not there yet XCode insists it is (even after a "clean"). How annoying.
-
Chris Prince almost 7 yearsIn my case, I have this warning, but the
adjustsFontForContentSizeCategory
key doesn't appear in the Source Code. -
Chris Prince almost 7 yearsIn my case, this box is unchecked, but I am getting the warning.
-
Chris Prince almost 7 years
I changed the font in the label that showed the error, to a dynamic type,
-- I can't see any option that looks like it would be adynamic type
in the fonts. Suggestions? -
K. Law almost 7 yearsI am now using the system font. I was using a custom font in some of the labels, which caused the problem. If you google dynamic fonts in Xcode, you may be able to find a list of other fonts which are dynamic. A little research goes a long way. Good luck.
-
user664939 over 6 yearsHow can you determine if your font is "non-dynamic"?
-
Shah Nilay over 6 years@user664939 Non-dynamic fonts are able to change family and style. Dynamic fonts are not able to change family and style. It will get default as per size. you can set family and style from storyboard -> attribute inspector -> font.
-
leanne over 6 years@user664939: instead of selecting a specific font, you select a font "type". Click the boxed "T" in the Font dropdown. In the window that opens, click the arrows to the right of that Font dropdown. Choose a "Text Style" from the list at the bottom. See the HIG's Visual Design, Typography section for info on point sizes, etc, related to each text style.
-
eemrah about 6 yearsHi @K.Law thanks for answer but Xcode generate several same warning and all of the views are in the Intro.storyboard. When I clicked warning, Xcode just show the Storyboard not a spesific item.
-
Mojo66 about 6 yearsStep 1: press ⇧⌥⌘K to clean the project and derived data. Omit step 3.
-
Yaro almost 6 yearshmmm, ⇧⌥⌘K cleans the build folder inside the app's derivedData. But it does not deletes the whole derivedData folder. Is that enough? Or we do the usual "xCode Voodoo Dance" as described above :D
-
danomatika over 5 yearsVoodoo Dance worked for me. I had the same issue and for deprecated Push Segues as well. I manually changed every segue and label but warnings did not go away. Removing the DerivedData folder fixed it.
-
btrballin about 5 yearsChanging it to
body
seems to make it lose the ability to be bolded text. -
DrWhat over 4 yearsIn my Xcode (11.1), there is no "Automatically adjusts font" box. I tried everything else, nothing worked, except this - with 0 votes. Thx
-
garafajon over 4 yearsI think it works now (Xcode 11) to just click on the warning and it selects the offending label. (So you can avoid the source code steps)
-
ScottyBlades about 4 years@ChrisPrince, did you wind up solving that?
-
dbDev about 3 yearsThis is the correct answer and should be marked as such.
-
Marlhex almost 3 yearsThe adjustsFontForContentSizeCategory are for UITextField issues and adjustsFontSizeToFit for UILabel issues