0

I need to set alpha parameter for my UITabBar. I do that the following way:

self.tabBarController?.tabBar.alpha = CGFloat(0.2)

Probably it works, but here is result: enter image description here

As you can see UIBarButtonItem has alpha of 0.2 too. How can I set separate alpha for UITabBar and UITabBarItem?

Nikita Zernov
  • 5,465
  • 6
  • 39
  • 70

2 Answers2

0

There is no way of doing it with alpha property. Put background image to your UITabBar. This image can be just semi transparent png file.

m8labs
  • 3,671
  • 2
  • 30
  • 32
0

Instead of changing the alpha value, use a background image for the bar, with the desired alpha value.

Léo Natan
  • 56,823
  • 9
  • 150
  • 195