一.在AppDelegate中添加以下这行代码
![](https://img.haomeiwen.com/i2226961/a24a1901e69c1425.png)
二.如果针对某一类型控件统一颜色可以用Method Swizzling进行设置
1.给控件新增一个分类,添加你需要交换的方法。
2.通过runtime中方法class_getInstanceMethod,获取方法实例。
3.再通过method_exchangeImplementations进行交换方法。
1.给控件新增一个分类,添加你需要交换的方法。
2.通过runtime中方法class_getInstanceMethod,获取方法实例。
3.再通过method_exchangeImplementations进行交换方法。
本文标题:一句代码统一当前viewCtroller的颜色
本文链接:https://www.haomeiwen.com/subject/nlgvmxtx.html
网友评论