在做一款app,要求用户设置大中小三个字体大小,如果用户选择了大的字体,如何动态的改变全部控件的字体大小。类似于微信或者支付宝,用户自己调整字体大小?
认证0级讲师
Use method swizzle to kill UIButton UILabel 等控件的 - (id)init 方法,在自己实现的方法中,先调原生的,然后添加通知监听 FontDidChangedNotificationKey. If the user changes the settings, just send a notification
UIButton
UILabel
- (id)init
FontDidChangedNotificationKey
Use method swizzle to kill
UIButton
UILabel
等控件的- (id)init
方法,在自己实现的方法中,先调原生的,然后添加通知监听FontDidChangedNotificationKey
. If the user changes the settings, just send a notification