2010-07-14 209 views
0

當視圖將方向從一種模式更改爲其他模式時,我需要顯示淡入類型的過渡效果。任何人都可以告訴我如何獲得?方向更改

回答

1

我會用一個動畫塊這個方法裏面,像這樣:

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { 
    [UIView beginAnimations:@"InterfaceFade" context:nil]; 
    [UIView setAnimationBeginsFromCurrentState:YES]; 
    [UIView setAnimationDuration:duration]; 

    // Change properties to animate here (Ex: view.alpha = 0.0) 

    [UIView commitAnimations]; 
} 
+0

衰落的作品,但我仍然可以看到窗口旋轉prioir它。我有沒有辦法解決這個問題?很多謝謝你的迴應。 – scs 2010-07-14 13:52:40