美文网首页UI
iOS开发之TabBar背景色设置

iOS开发之TabBar背景色设置

作者: 朱晓晓的技术博客 | 来源:发表于2019-01-23 15:57 被阅读0次
// 第一种方式
[[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;

相关文章

网友评论

    本文标题:iOS开发之TabBar背景色设置

    本文链接:https://www.haomeiwen.com/subject/guxsjqtx.html