【发布时间】:2014-04-14 16:02:49
【问题描述】:
我目前有以下“控制器树”:
UITabBarController
┣━ UIViewController (A)
┃ ┗ MKMapView
┣━ UINavigationController
┃ ┣━ UITableViewController (X)
┃ ┗━ UITableViewController (B)
┣━ UIViewController(没意思)
┗━ UIViewController(没意思)
在第二个视图 (B) 中,我将按钮连接到 IBAction:
- (IBAction)mapButtonTapped:(UIBarButtonItem *)sender {
UIView *startView = self.tabBarController.selectedViewController.view;
UIView *endView = ((UIViewController *)[self.tabBarController.viewControllers objectAtIndex:ELMapViewControllerIndex]).view;
ElMainMapViewController *carparkVC = [self.tabBarController.viewControllers objectAtIndex:ELMapViewControllerIndex];
[UIView transitionFromView:startView toView:endView duration:ELAnimationDuration
options:UIViewAnimationOptionTransitionCrossDissolve
completion:^(BOOL finished) {
}];
}
代码取自: iPhone: How to switch tabs with an animation?
一切正常——当我点击按钮时,我的第二个选项卡视图略微更改为第一个,一切都按我的意愿工作。
不幸的是,我的 QA 同时单击了返回按钮和连接到上述功能的按钮。这有时会导致锁定UITabBar。我可以移动MKMapView 和任何子视图,但UITabBar 的行为类似于禁用用户交互。
如果这个“组合”没有锁定UITabBar,它有时会导致B中后退按钮附近的“ ViewController 应该薄得多。
我真的不知道如何解决这个问题。我检查了 viewWillAppear 和其他函数,但没有一个与UITabBar 有交易(我在任何其他函数中都没有引用UITabBar)。
编辑
我在 tabBar 中删除了更改选定的索引,但仍然出现此问题。
【问题讨论】:
标签: ios uiview uiviewcontroller transition uitabbar