Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting title of UINavigationBar

I have an application which uses a main story board to include a Navigation Controller where the main view is a Table View using a prototype cell content. Each cell in the table view pushes onto a new view which I have created with it's own set of .h .m and .xib files.

The table view navigation bar has its title set through the story board which works fine. However, I am having trouble setting the title for each new view after it gets pushed into view.

I have the following in the viewDidLoad method for each view;

self.title = @"View Title";

Any advice?

like image 465
Paul Morris Avatar asked Dec 15 '11 11:12

Paul Morris


People also ask

How do I add a title to my navigation bar?

Use navigationBarTitle(_:) to set the title of the navigation bar. This modifier only takes effect when this view is inside of and visible within a NavigationView .

How do I change the navigation bar on my iPhone?

A user changes the navigation bar's style, or UIBarStyle , by tapping the “Style” button to the left of the main page. This button opens an action sheet where users can change the background's appearance to default, black-opaque, or black- translucent.


1 Answers

it is the right way. it will work.

like image 192
Rohan Avatar answered Oct 17 '22 20:10

Rohan