2010-10-19 77 views
1

在portaint Actionsheet在tabbar中顯示。在風景 - 在窗口。我希望在旋轉之前從tabbar移除UIActionSheet,以便在旋轉顯示之後進行旋轉。 裏面– willRotateToInterfaceOrientation:duration解僱行動表不工作。設備旋轉前關閉UIActionSheet?

回答

4

您可以使用NSNotification。收藏此通知在你的viewDidLoad文件,你預訂購得到通知時,方向是不會改變:

[[NSNotificationCenter defaultCenter] addObserver:self 
    selector:@selector(OrientationChanged:) 
    name:@"UIDeviceOrientationDidChangeNotification" 
    object:nil]; 

...添加這個方法:

-(void)OrientationChanged 
{ 

} 

NSNotification class reference

+0

您可以在此也 http://www.cocos2d-iphone.org/forum/topic/2588 – FAsttrack 2010-11-13 11:24:56

0

我我之前解僱和顯示後,然後UIActionSheet中間被取代;

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration 
{ 
    [APP.validSave dismissWithClickedButtonIndex:1 animated:NO]; 
} 
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation 
{ 
    [APP.validSave showInView:APP.navController.view]; 
}