开发者

Restoring navigationItem.title after removing navigationItem.titleView

开发者 https://www.devze.com 2023-04-06 08:24 出处:网络
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.

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 displa开发者_C百科y a title, e.g:

Restoring navigationItem.title after removing navigationItem.titleView

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?


Simply setting:

navigationItem.titleView = nil;

Will restore the text title.

0

精彩评论

暂无评论...
验证码 换一张
取 消