IPhone - Create Transparent Tab Bar

How to make transparent tab on cocoa tab?

+3
source share
2 answers

Since it UITabBaris a subclass UIView, have you tried setting its property alpha?

Please note that if you are trying to change the tab bar associated with UITabBarController, you should consider this warning from Apple, located in the link forUITabBar :

Important: In iOS 3.0 and later, you should not try to use the methods and properties of this class to change the tab bar when it is associated with the tab bar controller object. Changing the tab bar in this way throws an exception. Instead, any changes to the tab bar or its elements should appear through the tab bar of the controller. You can still directly modify the tab bar object that is not associated with the controller tab bar.

+2
source

Now with iOS 5, you can change the look of UITabBar to make only the background transparent with a simple line of code:

[[UITabBar appearance] setTintColor:[[UIColor alloc] initWithRed:0 green:0 blue:0 alpha:0.2]];
+3
source

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


All Articles