简体   繁体   English

iPhone在标签栏中的两个视图控制器之间翻转

[英]iphone flip between two view controllers in a tabbar

I have an application with a tabbar, and each controller inside a tabbar has a navigationbar. 我有一个带有标签栏的应用程序,并且标签栏内的每个控制器都有一个导航栏。 In one of the tabs, I would like to flip between the currently shown controller, and another viewcontroller. 在一个标签中,我想在当前显示的控制器和另一个视图控制器之间切换。 Tabbar and everything else has to remain as is. 标签栏和其他所有内容都必须保持原样。 I don't want to use pushViewController animated because that would hide the tabbar. 我不想使用pushViewController animated因为那样会隐藏标签栏。 I've seen many examples with flipping the views inside the same view controller, but I just can get it right when it comes to flipping views of two different controllers. 我已经看到了很多在同一个视图控制器中翻转视图的示例,但是在翻转两个不同控制器的视图时,我只是弄对了。
I would like to know: 我想知道:
1) How to flip only the area between the navigation bar and the tabbar? 1)如何仅翻转导航栏和标签栏之间的区域?
2) How to flip the entire controller including the navigation bar? 2)如何翻转整个控制器,包括导航栏? (But leaving tabbar as is). (但保留标签栏不变)。

I think the 2) is just presenting a view controller modally using a flip animation: 我认为2)只是使用翻转动画以模态呈现视图控制器:

viewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; viewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizo​​ntal;

Following code is use for the implementing the animation on the view for that you need to Import QuartzCore.framework in your project. 以下代码用于在视图上实现动画,因为您需要在项目中导入QuartzCore.framework。

CATransition *tr=[CATransition  animation];
tr.duration=0.75;
tr.timingFunction=[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
tr.type=kCATransitionPush;
tr.subtype=kCATransitionFromRight;
tr.delegate=self;
[self.window addSubview:self.nvCtr.view];
[self.nxtdSplashVCtr.view removeFromSuperview];
[self.window.layer addAnimation:tr forKey:nil];



 - For AnimationType you can use following option.

 1. kCATransitionMoveIn
 2. kCATransitionPush
 3. kCATransitionReveal
 4. kCATransitionFade


- For AnimationSubType you can use following option.

1. kCATransitionFromLeft
2. kCATransitionFromRight
3. kCATransitionFromTop
4. kCATransitionFromBottom

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM