快速改变UINavigationController和UITabBarController相关属相的方法

修改UITabBar中的TintColor和BarTintColor的颜色(对所有的UITabBar都起作用)

[[UITabBar appearance] setTintColor:[UIColor colorWithRed:0.407 green:0.867 blue:0.319 alpha:1.000]];
    [[UITabBar appearance] setBarTintColor:[UIColor colorWithRed:0.859 green:0.204 blue:0.219 alpha:1.000]];

修改UINavigationBar中的TintColor和BarTintColor的颜色(对所有的UINavigationBar都起作用)

[[UINavigationBar appearance] setTintColor:[UIColor colorWithRed:0.565 green:0.565 blue:1.000 alpha:1.000]];
    [[UINavigationBar appearance] setBarTintColor:[UIColor 
colorWithRed:0.327 green:1.000 blue:0.293 alpha:1.000]];

修改颜色的另一种方法:

[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor redColor]}];
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容