2010-12-19 84 views

回答

1

退房的UIViewController這些方法:

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html

// Notifies when rotation begins, reaches halfway point and ends. 
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration; 


- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation; 

// Faster one-part variant, called from within a rotating animation block, for additional animations during rotation. 
// A subclass may override this method, or the two-part variants below, but not both. 
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); 

// Slower two-part variant, called from within a rotating animation block, for additional animations during rotation. 
// A subclass may override these methods, or the one-part variant above, but not both. 
- (void)willAnimateFirstHalfOfRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration; 
- (void)didAnimateFirstHalfOfRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation; // The rotating header and footer views are offscreen. 
- (void)willAnimateSecondHalfOfRotationFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation duration:(NSTimeInterval)duration; // A this point, our view orientation is set to the new orientation. 

享受

+0

非常感謝您! – 2010-12-19 19:21:19

1

有許多在UIViewController中的事件被旋轉時引發的。旋轉之前的以下兩個觸發器:

- (void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 

「在用戶界面開始旋轉之前發送到視圖控制器。

- (void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration 

「在執行一步用戶界面旋轉之前發送到視圖控制器。」