2010-03-12 5 views
0

selon mon code lorsque mon appareil sont utilisés dans Paysagecomment faire pivoter au courant d'Orientation?

quand je pushViewController il sera

show automatique UIDeviceOrientationPortrait.

je dois tourner mon appareil Portrait, puis tourner à Paysage,

il présentera en mode paysage.

comment puis-je faire pivoter le courant d'orientation sans utiliser l'API privée (setOrientation)?

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

Répondre

2

Essayez le réglage de l'orientation de la barre d'état:

UIApplication *app = [UIApplication sharedApplication]; 
[app setStatusBarOrientation: UIInterfaceOrientationLandscape]; 
[app setStatusBarHidden: NO animated: YES]; 

Vous pouvez obtenir l'orientation actuelle de l'appareil comme celui-ci:

[UIDevice currentDevice].orientation 
+0

grâce Plamen Dragozov – RAGOpoR

+0

-il pas répondu à ma question. – RAGOpoR