使用传统的UITabBar + UINavigationController
设计范例,您如何实现Instagram中央选项卡点击的效果 - 整个UITabBarController
显示负责拍摄照片的捕捉UIViewController
。
你如何复制这样的行为?对我来说最有趣的部分是,你究竟如何将模态视图置于实际UITabBarController
之下?现在我最接近的是呈现UIViewController
传统的UIModalTransitionStyleCoverVertical
演示风格,这完全不是我想要的:
- (void)viewWillAppear:(BOOL)animated{
if (!recordDisplayed){
SGRecordViewController *customController = [[SGRecordViewController alloc] init];
customController.modalPresentationStyle = UIModalPresentationFormSheet;
customController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentViewController:customController animated:YES completion:nil];
recordDisplayed = YES;
previousIndex = [self tabBarController].selectedIndex;
}else{
[self tabBarController].selectedIndex = previousIndex;
recordDisplayed = NO;
}
}