2010-10-19 3 views
1

Dans portaint Actionsheet afficher dans la barre d'onglets. Dans le paysage - dans la fenêtre. Je tiens compte de retirer UIActionSheet de la barre d'onglets avant de faire pivoter, pour après, tour show dans wondow. À l'intérieur – willRotateToInterfaceOrientation:duration ignorer feuille d'action ne fonctionne pas.Ignorer UIActionSheet avant la rotation de l'appareil?

Répondre

4

Vous pouvez utiliser NSNotification pour cela. Ajouter cette notification dans votre fichier viewDidLoad vous willl avoir avisez lorsque l'orientation va changer:

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

... ajouter cette méthode:

-(void)OrientationChanged 
{ 

} 

Voir NSNotification class reference.

+0

vous pouvez aussi cette http://www.cocos2d-iphone.org/forum/topic/2588 – FAsttrack

0

Me rejeter avant la rotation et montrer après, puis la UIActionSheet est remplacé au milieu;

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