2010-12-08 11 views
0

Je suis en train de créer une application et j'aimerais qu'elle soit uniquement en mode paysage, même si elle est tournée. Après avoir lu autour, je l'ai mis en place aline de code comme ceci:iPad Paysage uniquement (gauche ou droite)

- (BOOL)shouldAutorotateToInterfaceOrientation:UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);} 

Cela fonctionne, mais je voudrais l'interface de tourner, mais toujours en mode paysage seulement, avec bouton d'accueil à gauche ou à droite, comme beaucoup d'autres applications font ...

Comment l'obtenir?

Répondre

3

Essayez ceci:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    return UIInterfaceOrientationIsLandscape(interfaceOrientation); 
} 
+0

merveilleux, merci beaucoup! – Antonio

+0

Mon application tourne toujours .. –

1

Vous êtes très proche, juste besoin de soutenir tous les orientations paysage, le plus facilement fait en utilisant la macro UIInterfaceOrientationIsLandscape.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    return UIInterfaceOrientationIsLandscape(interfaceOrientation); 
} 
Questions connexes