UIToolbar is translucent, not black

What is the easiest way (if possible, without using drawRect, subclassing, category) to have a transparent UIToolbar with a non-black color of my choice? I know that you can set the translucent property of UIToolbar, but the color is black, I tried to set the background color, but it did not work. I tried setting the background image and it works, but it is not transparent.

+4
source share
3 answers

Take a look at the setTintColor: method. For instance:

 [self.navigationController.toolbar setTintColor:[UIColor greenColor]]; 
+1
source

Try using IB, it should work:

  • set the hue color of the toolbar to your color choice.
  • set the Alpha toolbar to 0.5 or according to the desired transparency.
0
source

Answers with sample code can be found in this question: Impossible to transparency UIToolBar?

Seba

0
source

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


All Articles