Setting title for navigationItem

657 views Asked by At

I have inserted some view in titleView which is in navigationItem like this self.navigationItem.titleView=someView; after this i set it as nil self.navigationItem.titleView=nil; then after this i can't set title in navigationItem as [self.navigationItem setTitle:@"Title"];.

so how can i set title for navigationItem.give me some idea.

Thanks

1

There are 1 answers

2
Ken Pespisa On

I think you have the right idea. According to the docs, setting the titleView to nil should make the title text appear. I would bet your issue is when in the lifecycle you do that. I believe adding that code in viewWillAppear would be fine.