I have a reference of UIViewController
. From that reference i want to get references to all my navigation bar and bar button items and apply custom styles on them.
How can i achieve this on iOS 5?
I have a reference of UIViewController
. From that reference i want to get references to all my navigation bar and bar button items and apply custom styles on them.
How can i achieve this on iOS 5?
You can do something like that.
[backbutton setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor blackColor],UITextAttributeTextColor,[UIFont fontWithName:TEXTFONT size:16.0f],UITextAttributeFont,
nil] forState:UIControlStateNormal];
Assuming your view controller has a navigation controller, you should be able to access the navigation bar and its items using the following code:
UINavigationBar *navBar = [myViewController.navigationController.navigationBar];
NSArray *navBarItems = navBar.items;