开发者

Pop navigation controller and select tab?

开发者 https://www.devze.com 2023-04-08 13:17 出处:网络
Hi guys I have a navcontroller inside a tabbar. When I select a button inside the root view controller I push another view controller. In it I take some user input and have a finish button.

Hi guys I have a navcontroller inside a tabbar. When I select a button inside the root view controller I push another view controller. In it I take some user input and have a finish button.

My problem is that when the user selects this button I want to go straight to a开发者_JAVA百科nother tab, but at the same time I want to pop to the root view controller in the current tab, so that the next time the user presses the tab he/she will go to its original state. Any ideas?


after pop the navigation controller call the setSelectedIndex: on your tab bar controller instance.

and you can also handle your tab bar controller delegates in your app delegate -

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController

here you can pop your navigation controller to root.

0

精彩评论

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

关注公众号