How to change tab strip color instead of blue?

Usually the color of the tab bar selection is blue on the iPhone. Instead, I want to change the color to brown. How to change tab selection color? Should I create a custom table controller?

+4
source share
3 answers

yes, if you create a customTabBar controller and switch the background image of the TabBar control, then its work, like the TabBar system ... you just create 5 different images and set them with the selected tab in the TabBar delegate method, here if you use graphic image, then it also works ..... means that you use this tab globally in many applications :)

+5
source

If you want to use the image:

[self.tabBar setSelectionIndicatorImage: [UIImage imageNamed: @ "selected_tab.png"]];

If you want to use color:

[self.tabBar setSelectedImageTintColor: [UIColor whiteColor]];

+6
source
tabBar.tintColor = [UIColor redColor]; 
+2
source

Source: https://habr.com/ru/post/1412342/


All Articles