I want to apply a custom alpha value to the title of the UINavigationBar
. The UINavigationBar
is part of the UINavigationController
and the UINavigationController
is part of a UITabBarController
.
Edit: Here is a picture of what I created using a UIToolbar and a UILabel. I want to do the same using the title in the UINavigationController: https://i.sstatic.net/B8YX0.png
I think the only way to accomplish this would be to subclass the UINavigationBar
and override a method that allows me to set the Alpha when it's drawn.
Here are my questions:
UINavigationBar
to my custom class, correct?This is something you shouldn't do. Why would you want to change that color but not the overall opacity of the bar? it decreases readability. There are multiple problems:
If you really want to do it, there's only one clean, public way: Give each navigation item to be pushed a custom title view. You can tamper with that one as much as you want. So it's possible to set a view with a UILabel
as subview and having it's alpha set to 0.5.