设置UITabBarController的背景颜色

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

 

posted @ 2015-01-15 11:43  爱生活爱代码  阅读(1366)  评论(0编辑  收藏  举报