开发者

iPhone pop navigation controller when tab bar selected

开发者 https://www.devze.com 2023-01-29 11:07 出处:网络
I have a开发者_开发问答n iPhone app with a tab bar and in the first tab there is a UINavigationController. How can I force the navigation controller to popToRoot when selecting the tab? The default be

I have a开发者_开发问答n iPhone app with a tab bar and in the first tab there is a UINavigationController. How can I force the navigation controller to popToRoot when selecting the tab? The default behaviour does this the second time you select it but I wish to do it on the first one.

Thanks


One way to do this would be to use UITabBarControllerDelegate’s –tabBarController:didSelectViewController: method to be notified when the user selects the navigation controller. Then, in that method, pop your navigation controller as desired.

0

精彩评论

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