iOS开发设置关于tabBar和navigationBar以及item中的一些全局属性
/* To set item label text attributes use the appearance selectors available on the superclass, UIBarItem.
*/
//UI_APPEARANCE_SELECTOR当后面带有这个宏的时候一般都可以使用appearance来配置
//全局配置UITabBarItem的文字属性
[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithRed:63/255.0 green:59/255.0 blue:117/255.0 alpha:1],NSFontAttributeName:[UIFont boldSystemFontOfSize:20]} forState:UIControlStateSelected];
/*
设置状态栏样式,如果需要通过Application去设置样式的话,
需要在info.plist文件中增加一配置“view Controller-base status bar appreance的值为NO”
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
*/
//设置statusBarStyle注意全局配置时,需要在plist里的设置
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
//设置UINavigationBar的背景图片
[[UINavigationBar appearance] setBackgroundImage:[UIImage getImageWithImage:[UIImage imageNamed:@"bg"]] forBarMetrics:UIBarMetricsDefault];
//设置UINavigationBar上title的文字属性
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];