hi all, i want to change the NavigationItem title color. Also i want to the change the text color of back button of navigation bar. Please suggest how can i do this task? i am using iPhone Os sdk 3.1.2
A:
You can set the titleView, defined in UINavigationBar.h as:
@property(nonatomic,retain) UIView *titleView;
// Custom view to use in lieu of a title. May be sized horizontally. Only used when item is topmost on the stack.
Pop your own UILabel in there with whatever color you want.
Also, you'll get more responses if you don't have a 7% accept rate. Go back and accept some of the answers you've gotten for previous questions, they can't all be bad.
Kenny Winker
2009-11-05 11:24:26
+1
A:
One part of this question has already been answered.
Then, to change the back button title color, I would suggest creating a custom button with a label:
UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithCustomView:yourViewWithColoredText];
navigationItem.leftBarButtonItem = buttonItem; // assign it as the left button
yourViewWithColoredText
should be a custom view containing your colored text.
Then depending on what you want, you could make it look like a standard back button.
Jean Regisser
2009-11-05 11:27:22