在iOS中忽略dynamictypes:辅助function

有没有办法在iOS应用程序中完全忽略dynamictypes/字体大小设置? 我的意思是有一个像plist项目的方式,以便我可以完全禁用它。 我知道有一个通知,我们可以观察和重新configuration字体,每当设置发生变化。 我正在寻找一个更简单的解决scheme。 我正在使用iOS8。 谢谢。

在你的AppDelegate添加:

 #import <objc/runtime.h> @implementation AppDelegate NSString* swizzled_preferredContentSizeCategory(id self, SEL _cmd) { return UIContentSizeCategoryLarge; // Set category you prefer, Large being iOS' default. } - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { Method method = class_getInstanceMethod([UIApplication class], @selector(preferredContentSizeCategory)); method_setImplementation(method, (IMP)swizzled_preferredContentSizeCategory); ... }