您的位置:首页 > 产品设计 > UI/UE

设置UITabBarController的背景颜色

2015-01-15 11:43 190 查看
if (IOS7) {
self.tabBarController.tabBar.barTintColor = kTAB_BAR_GB_COLOR;
}else{
self.tabBarController.tabBar.tintColor = kTAB_BAR_GB_COLOR;
[[UITabBar appearance] setBackgroundImage:[ZQUtiles imageWithColor:kTAB_BAR_GB_COLOR size:CGSizeMake(29, 1)]];//设置背景,修改颜色是没有用的

[[UITabBar appearance] setSelectionIndicatorImage:[ZQUtiles imageWithColor:kTAB_BAR_GB_COLOR size:CGSizeMake(29, 1)]];

[[UITabBar appearance] setShadowImage:[ZQUtiles imageWithColor:kDEFAULT_BG_COLOR size:CGSizeMake(29, 1)]];//隐藏那条黑线

[[UITabBarItem appearance] setTitlePositionAdjustment:UIOffsetMake(0, -2)];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: