简体   繁体   English

如何在我的iOS应用程序中禁用辅助功能字体粗体显示?

[英]How to disable accessibility font bolding in my iOS app?

I can detect if fonts are bold because of accessibility in iOS, using UIAccessibilityIsBoldTextEnabled , but I can't disable font bolding in my app. 我可以使用UIAccessibilityIsBoldTextEnabled来检测字体是否由于iOS中的可访问性而为粗体,但无法在我的应用程序中禁用字体粗体。

Is there any way so I can keep my app from bolding, because my texts are already bold and accessibility will make them even bolder ! 有什么办法可以防止我的应用程序以粗体显示,因为我的文本已经是粗体了,可访问性会使它们更加粗体!

Wouldn't that work only if the user has enabled Bold Text in the settings, else, why would you want to go against the User Preference? 仅当用户在设置中启用了粗体字时,该功能才会起作用,否则,为什么要违反用户首选项?

Else, you can try overriding the setting using this: 另外,您可以尝试使用以下方法覆盖设置:

AnyUIView.appearance().font = UIFont(name: "yourFont", size: yourSize)

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM