Timur Mustafaev
Timur Mustafaev

Reputation: 4929

Change UINavigationController style on the fly - objective-c

I have 2 UIViewControllers: A and B. B is Detailed view of A. In A view, my UINavigationViewController has Default style. I want to change style of navigationController to BlackOpaque, when I push B viewController. How to do this? In B viewDidLoad method, i tried to do this:

self.navigationController.toolbar.barStyle = UIBarStyleBlackOpaque; 

But this doesn't work.

Upvotes: 1

Views: 1260

Answers (1)

albertamg
albertamg

Reputation: 28572

You are changing the style of the toolbar, not the style of the navigation bar. This should do it:

self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 

Upvotes: 5

Related Questions