2010-08-18 123 views
2

UIModalTransitionStyle是垂直,翻轉或溶解。我希望它是正確的左或從左到右,就像您點擊MapKit標註或基於導航的應用程序上的披露按鈕一樣。UIModalTransitionStyle水平移動

回答

5

這是不可能的,因爲對於一個模式的viewController過渡,但你可以使用一個CATransition與類型的kCATransitionMoveInkCATransitionPushkCATransitionFromRight

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 
+1

眼下亞型「someOtherView」只是過渡時期「消失NewView的」。我希望「someOtherView」在整個動畫中仍然可以在「newView」下面看到。這可能嗎? – 2012-06-13 12:49:31