TabBar背景颜色设置

 

// 第一种方式
//    [[UITabBar appearance] setBarTintColor:[UIColor blackColor]];
//    [UITabBar appearance].translucent = NO;
    // 第二种方式
    UIView *view = [[UIView alloc]init];
    view.backgroundColor = [UIColor redColor];
    view.frame = self.tabBar.bounds;
    [[UITabBar appearance] insertSubview:view atIndex:0];
    
//    //还有第三种方法就是使用背景图片:
//    [[UITabBar appearance] setBackgroundImage:[UIImage imageNamed:@"tabBarBackgroundImage"]];
//    [UITabBar appearance].translucent = NO;

 

posted @ 2018-04-07 10:31  宁静暖风  阅读(6279)  评论(0编辑  收藏  举报