A quick iPhone question, I currently use a people picker in my application, I use a black navigation bar in my application but the people picker displays in the default blue color.
I have tried:
picker.navigationBar.backgroundColor = [UIColor blackColor];
However it still displays in the blue color.
Is it possible to change the color of the navigation bar on the people picker? Or is it always going to be blue as it is a system Modal view?
EDIT:
Using the following works for the color:
picker.navigationBar.tintColor = [UIColor blackColor];
However using:
picker.title = @"MyText";
or
picker.navigationItem.title=@"MyText";
or
self.title=@"MyText";
Doesn't work, the title always remains as "All Contacts"
The color of a UINavigationBar is controlled by its tintColor
property.
You can change the color of all navigation bars in your app by making a category on UINavigationBar
. Just note that all changes you make in a category are applied across all instances of that class in your app.
In your category, in the init
method, change self.tintColor
.
Since categories change all instances of a class in your app, it will be trickier to change the text with a category. Instead, try setting the title
of the target view.