当用户在选项卡栏应用中单击时,如何重置uinavigationview以显示根控制器 [英] How to reset a uinavigationview to display the root controller when user clicks back to it in a tab bar app

查看:39
本文介绍了当用户在选项卡栏应用中单击时,如何重置uinavigationview以显示根控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户在标签栏应用中单击时,如何重置uinavigationview以显示根控制器

How to reset a uinavigationview to display the root controller when user clicks back to it in a tab bar app

只是想知道我会怎么做.我的代表中有导航控制器以及选项卡控制器,并且每当用户单击另一个选项卡时,如果他们单击包含uinavcontroller的选项卡,则我希望在导航控制器上显示rootview.

Just wondering how I would do this. I have the navcontroller in my delegate along with the tabbar controller and Any time the user clicks to another tab I want the rootview on the navigation controller to be shown if and when they click back the the tab that contains the uinavcontroller.

这有意义吗?

尼克

推荐答案

[self.navigationController popToRootViewControllerAnimated:YES];

[self.navigationController popToRootViewControllerAnimated:YES];

或者,如果您不希望它进行动画处理,则为否.

Or NO if you don't want it to animate.

通过这种方式,所有缓存的视图仍然存在,即,除非NavigationController认为必要,否则您不会删除/释放"根视图上方的所有视图.

This way all the views that were cached are still there, i.e. you don't "remove/release" all the views above the root view, unless the navigationController deems it necessary.

我希望这就是您想要的.

I hope this was what You were looking for..

这篇关于当用户在选项卡栏应用中单击时,如何重置uinavigationview以显示根控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆