Search code examples
iphoneobjective-ciosipaduitoolbar

UIToolbar to have translucent and not black color


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


Solution

  • Have a look at the setTintColor: method. For example:

    [self.navigationController.toolbar setTintColor:[UIColor greenColor]];