问题描述
我的应用有2个标签( tabA 和 tabB ),根据我设置的位置 navigationItem.titleView
tabB 到 UIImageView
时 - viewWillAppear:
被调用。
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.
tabB的默认行为 只是显示标题,例如:
The default behaviour of tabB is to simply display a title, e.g:
问题是当位置发生变化时我删除 UIImageView
navigationItem .titleView
(使用 - removeFromSuperview
),默认标题也已消失,并尝试将其设置为:
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?
推荐答案
只需设置:
navigationItem.titleView = nil;
将恢复文字标题。
这篇关于删除navigationItem.titleView后恢复navigationItem.title的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!