Guangyu Wang
Guangyu Wang

Reputation: 147

How to link customized navigation bar to navigation controller?

I created a normal view controller with a customized navigation bar. Later I changed my mind to embed the view controller into a navigation controller. And I noticed that embedding the view controller into a navigation controller will create another navigation bar!

As the image show: enter image description here

I am wondering if there is a way to replace the navigation bar created by navigation controller with my own customized bar? Or, if it's not possible, is there a way to configure the new navigation bar? Because for some reason it's not shown in my interface builder.

Upvotes: 0

Views: 834

Answers (2)

Mahesh
Mahesh

Reputation: 996

You have 2 solutions

  1. Hide the system navigationbar using below code so it was display your custom navigation.

    self.navController.navigationBarHidden = YES;

  2. Customize the system navigation bar with its background color, back button and title text color. For this you can refer a below links which provide you detail of its http://www.appcoda.com/customize-navigation-status-bar-ios-7/

Upvotes: 1

Hyder
Hyder

Reputation: 1173

You can change the color and buttons of the UINavigationBar provided by the system and make it look like yours.

Upvotes: 0

Related Questions