How to change UITabBar Selection color

前端 未结 13 807
遇见更好的自我
遇见更好的自我 2020-12-13 09:02

I need to change the selection color of UITabBar from default blue to red. How do we do this.

13条回答
  •  -上瘾入骨i
    2020-12-13 09:43

    In iOS 7 it's simply the tintColor. One way to accomplish this could be to subclass UITabBarViewController, set the custom class in the storyboard, and in your viewDidLoad method of the subclassed tabBarVC add this:

    [[self tabBar] setTintColor:[UIColor redColor]];
    

提交回复
热议问题