Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restoring navigationItem.title after removing navigationItem.titleView

My App has 2 tabs (tabA and tabB), based on location the I set the navigationItem.titleView of tabB to a UIImageView when - viewWillAppear: is called.

The default behaviour of tabB is to simply display a title, e.g:

Default Title

The issue is when the location changes and I remove the UIImageView navigationItem.titleView (using - removeFromSuperview), the default title has also disappeared and trying to set it with:

self.navigationItem.title = @"TITLE";

Does not work. Any ideas on how to solve this?

like image 368
Richard Stelling Avatar asked Sep 19 '11 11:09

Richard Stelling


1 Answers

Simply setting:

navigationItem.titleView = nil;

Will restore the text title.

like image 82
Richard Stelling Avatar answered Jan 04 '23 13:01

Richard Stelling