//状态栏颜色
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
// 定义NavigationBar样式
[[UINavigationBar appearance] setTitleTextAttributes:@{NSFontAttributeName:kFont_Nav_Title,NSForegroundColorAttributeName:kColor_White}];
[[UINavigationBar appearance] setTintColor:kColor_White];
[[UINavigationBar appearance] setBackgroundImage:[UICommonCtrl imageWithColor:kColor_Blue] forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setShadowImage:[UICommonCtrl imageWithColor:kColor_Blue]];
//自定义返回按钮
UIEdgeInsets insets = UIEdgeInsetsMake(0, 0, -2.0, 0);
UIImage *alignedImage = [[UIImage imageNamed:@"icon_nav_back"] imageWithAlignmentRectInsets:insets];
[[UINavigationBar appearance] setBackIndicatorImage:alignedImage];
[[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:alignedImage];
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60)
forBarMetrics:UIBarMetricsDefault];
// 定义TabBar样式
[[UITabBar appearance] setTintColor:kColor_Blue];
[[UITabBar appearance] setShadowImage:[UICommonCtrl imageWithColor:SHORTCOLOR(0xe4)]];
[[UITabBar appearance] setBackgroundImage:[UICommonCtrl imageWithColor:kColor_White]];
[[UITabBarItem appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName : kColor_Blue }
forState:UIControlStateSelected];
[[UITabBarItem appearance] setTitleTextAttributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:11] }
forState:UIControlStateNormal];
iOS 自定义nav tab 样式
于 2016-08-30 13:45:51 首次发布