Reputation: 1
I'm developer in objective c and I need help with with set custom navigation bar on navigation controller programmatically I don't use story board or xib.
Upvotes: 0
Views: 3325
Reputation: 4953
you can use this, if your targeting iOS 5 and above
[MyNavigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"customNavBar.png"] forBarMetrics:UIBarMetricsDefault];
or
[[MyNavigationController.navigationBar appearance] setBackgroundImage:navBackground forBarMetrics:UIBarMetricsDefault];
you may need to add custom NavBar Buttons.
also have a look at the Answers here.
Upvotes: 1
Reputation: 2664
If you want more than just customizing appearance, then you can:
This way you have full control over your custom navigation bar. You can read about view controller containment in the documentation for UIViewController.
Upvotes: 0