从模态视图控制器ios7更改选项卡栏应用程序的选定索引

时间:2014-03-20 18:51:43

标签: ios7 uitabbarcontroller

我在ios7中的一个标签上展示了一个模态视图控制器。根据用户的操作,我想更改选项卡栏控制器的选定索引 我试过了       [(UITabBarController *)self.parentViewController setSelectedIndex:0];

这不会更改基础标签栏的selectedindex。如果还有其他方法可以让我知道

1 个答案:

答案 0 :(得分:7)

只做

UITabBarController *tabBarController = (UITabBarController *)self.presentingViewController;
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
[tabBarController setSelectedIndex:1];