iOS 7 TabBar Translucent issue

前端 未结 6 2069
慢半拍i
慢半拍i 2020-12-07 23:38

I have an issue, when I set the translucent box off on a TabBar, there is something blocking some of my view.

It looks like it\'s a sort of extra tab bar or I don\'t

6条回答
  •  悲哀的现实
    2020-12-07 23:51

    As mentioned here you have to set barTintColor to something you want to change the color.

    These settings automatically apply when you set any style for barStyle or any custom color for barTintColor. If you prefer, you can make the tab bar opaque by setting the translucent property to NO programmatically. In this case, the bar draws an opaque background using black if the tab bar has UIBarStyleBlack style, white if the tab bar has UIBarStyleDefault, or the tab bar’s barTintColor if a custom value is defined.

    Something that I used for my project

    self.tabBarController.tabBar.barTintColor = [UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:1.0];
    
    self.tabBarController.tabBar.translucent = NO;
    

提交回复
热议问题