2012-03-28 11 views
3

Es gibt eine weitere benutzerdefinierte UIViewController Übergang als die 4 Eingeborenen iOS:Benutzerdefinierter UIViewController-Übergang?

typedef enum { 
    UIModalTransitionStyleCoverVertical = 0, 
    UIModalTransitionStyleFlipHorizontal, 
    UIModalTransitionStyleCrossDissolve, 
    UIModalTransitionStylePartialCurl, 
} UIModalTransitionStyle; 

Irgendwelche Tipps?

Antwort

2

Sie könnten auch CATransition ausprobieren, zum Beispiel zeigt der folgende Code einen Übergang, bei dem eine zweite Ansicht Ihre aktuelle Ansicht nach rechts verschiebt. (Angenommen, dieser Code befindet sich in Ihrem Hauptansicht-Controller).

UIView *appWindow = [self.view superview]; 

CATransition *animation = [CATransition animation]; 
[animation setDuration:0.3]; 
[animation setType:kCATransitionPush]; 
[animation setSubtype:kCATransitionFromLeft]; 
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; 

[appWindow addSubview:yourSecondViewController.view]; 
[self.view removeFromSuperview]; 

[[appWindow layer] addAnimation:animation forKey:@"showSecondViewController"]; 
Verwandte Themen