ios “自动调整字体需要使用动态类型文本样式”警告是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43766513/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does the "automatically adjusts font requires using a dynamic type text style" warning mean?
提问by K. Law
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
.
我无法摆脱的警告是对的main.storyboard
。
I have checked every UILabel
in the Identity Inspector
to make sure the "Automatically Adjusts Font"is unchecked.
我已经检查每一个UILabel
中Identity Inspector
,以确保“自动调节字体”没有被选中。
采纳答案by K. Law
It seems to have been a bug in Xcode. This is what I did to fix it:
这似乎是Xcode中的一个错误。这是我为修复它所做的:
- 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.
错误仍然消失了。
回答by ayalcin
- Open your storyboard as Source Code
- Search for key "adjustsFontForContentSizeCategory"
- Check which object has this option and uncheck Dynamic Type checkbox from interface builder.
- 打开你的故事板作为源代码
- 搜索键“adjustsFontForContentSizeCategory”
- 检查哪个对象具有此选项并从界面构建器中取消选中动态类型复选框。
回答by Hyman
回答by Spilly
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.
我有同样的问题。即使我打开故事板作为源并删除“adjustsFontForContentSizeCategory”键,保存并清理它仍然会显示的项目。
So then I:
那么我:
- Cleaned the project
- Closed Xcode
- Deleted the derived data folder contents
- Re-Opened Xcode and rebuilt
- 清理了项目
- 关闭 Xcode
- 删除了派生数据文件夹内容
- 重新打开Xcode并重建
It was gone. :)
它不见了。:)