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)]; }