在iOS应用中使用大文本辅助功能 [英] Use Large Text Accessibility feature in iOS app

查看:160
本文介绍了在iOS应用中使用大文本辅助功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS设备中,可以在辅助功能设置中设置大文本。用户可以在此处指定不同的字体大小。我也想在我的应用程序中使用此字体大小。在辅助功能计划指南中,我的应用程序未找到有关访问此字体大小的任何信息。它仅提及标准的Apple应用程序邮件,联系人,日历等正在使用它。有人知道开发应用程序时是否可以访问此信息吗?



设置了大文本功能时,UIFont的静态-FontSize方法也不会返回不同的值。 / p>

注意:不要与iOS 7的新动态类型混淆。这是辅助功能设置下的另一种较旧的选项。)



解决方案

使用记录的API不可访问。



只是为了好玩不过:(请勿在真实应用中使用,它可能会让您被商店拒绝。



它存储在<$ c $下c> com.apple.Accessibility.plist ,键 preferredFontSize



MobileNotes.app (大概还有其他)使用函数

  extern float _UIAccessibilityLargeTextFontSize(float)来获取它; 

(实在无证,因此请确保以下划线开头。)


In iOS devices it is possible to set Large Text in the Accessibility Settings. The user can specify different font sizes here. I would like to use this font size in my app as well. I haven't found anything about accessing this font size in my app in the Accessibility Program Guide. It only mentions that the standard Apple apps Mail, Contacts, Calendars etc are using it. Does anyone know if this information is accessible when developing an app?

The static -FontSize methods of UIFont also do not return different values when the Large Text feature is set.

(NOTE: Not to be confused with iOS 7's new Dynamic Type. This is a different, older option under the Accessibility settings.)

解决方案

It's not accessible using documented APIs.

Just for fun though: (do not use in a real app, it will probably get you rejected from the store)

It's stored under com.apple.Accessibility.plist, key preferredFontSize

MobileNotes.app (and presumably the others) get it using the function

extern float _UIAccessibilityLargeTextFontSize(float);

(it's so undocumented they made sure to start it with an underscore.)

这篇关于在iOS应用中使用大文本辅助功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆