/** 这里用到个三方,转换color的进制*/
//三方 FlatUIKit
//设置导航条
//bar的背景颜色
[[UINavigationBar appearance] setBarTintColor:[UIColor colorFromHexCode:@"eb5352"]];
//文本颜色
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:[UIFont systemFontOfSize:18]}];
//tabBarItem全局设定
//图片选中的原始样式
self.tabBarItem.selectedImage = [self.tabBarItem.selectedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
//选中文本的颜色
[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorFromHexCode:@"eb5352"]} forState:UIControlStateSelected];
本文介绍了如何使用第三方库FlatUIKit来设置导航条(NavigationBar)的背景颜色、文字颜色以及字体大小,并对TabBarItem的选中状态进行定制,包括选中时的图片样式和文本颜色。
1314

被折叠的 条评论
为什么被折叠?



