Set different UINavigationController titles for embedded UITabBar subviews?

In my app I have embedded a UITabBarController inside of my UINavigationController. The problem is that the UINavigationController treats that tab bar as a single view controller even though there are 4 tabs in it. I am needing to have a different header title for each of those 4 tabs that displays in the navigation bar header. Using self.title on a subclass for those 4 views does nothing. It just displays the same title in the navigation bar constantly because like I said, the UINavigationController treats that entire tab bar controller as a single view.

How can I have separate titles for each of my views that are tabs inside the tab bar controller?



Try using [self.navigationItem setTitle:] inside each tab's view controller. If this does not work, try deeper, [self.tabBarController.navigationItem setTitle:] .

链接地址: http://www.djcxy.com/p/54970.html

上一篇: 旋转行为iOS8 vs iOS9

下一篇: 为嵌入的UITabBar子视图设置不同的UINavigationController标题?