iOS开发 修改tabBar背景色

2019-06-13  本文已影响0人  隔墙送来秋千影
第一种方式
[[UITabBar appearance] setBarTintColor:[UIColor whiteColor]];
[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;
上一篇 下一篇

猜你喜欢

热点阅读