UIModalTransitionStyle水平移动

时间:2010-08-18 07:34:04

标签: iphone iphone-sdk-3.0 animation modalviewcontroller

UIModalTransitionStyle是Vertical,Flip或Dissolve。我希望它向左或从左到右,就像您点击MapKit标注或基于导航的应用程序上的公开按钮一样。

1 个答案:

答案 0 :(得分:5)

这不可能作为模态viewController的转换,但您可以使用类型为kCATransitionMoveInkCATransitionPush且子类型为kCATransitionFromRight的CATransition

CATransition* trans = [CATransition animation];
trans.type = kCATransitionPush;
trans.subtype = kCATransitionFromRight;
trans.duration = 0.5;

[newView.layer addAnimation:trans forKey:@"PushFromRightEffect"];

[someOtherView addSubview:newView];
// Coded in Browser not tested