问题描述
我有一个MainMenu导航我到一个TabBarController,里面有4个视图(4个标签)。
I have a MainMenu which navigates me to a TabBarController with 4 views (4 Tabs) in it.
现在我在第4个视图中有一个按钮TabBarController哪个OnClick应该带我到MainMenu。
Now I've a button in the 4th view of the TabBarController which OnClick should take me to the MainMenu.
问题是当我pushViewController(MainMenu)我无法解除TabBarController而且NavigationBar在MainMenu !!
Problem is when I pushViewController (MainMenu) I'm not able to dismiss the TabBarController and also NavigationBar is not visible on the MainMenu!!
有人可以建议我如何解决这个问题,提前致谢。
Can someone please suggest me how to solve this, Thanks in advance.
推荐答案
不要使用这个:
[self.navigationController pushViewController:mainMenuViewController animated:YES];
尝试使用:
[self.navigationController popViewController Animated:YES];
获取相同MainMenu的引用,然后推送到该视图控制器
Take the reference of your same MainMenu and then push to that view controller
这篇关于如何在按钮单击时从UITabBarController退出到UINavigationController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!