2010-09-22 6 views

Répondre

1

La méthode ci-dessous « retour oui » fera le changement d'orientation si elle est " retourner NO "l'orientation ne changera pas. Utilisez cette méthode dans votre vue.

- (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) orientation 
{ 

return YES; 

} 

Tout le meilleur.

0

Mon application sandbox: https://github.com/comonitos/programatical_device_orientation

dans l'interface (fichier h):

BOOL rotated; 

mise en œuvre (fichier m):

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
    { 
    return rotated; 
    } 
    -(void) setup 
    { 
    rotated = YES; 
    [[UIDevice currentDevice] setOrientation:UIDeviceOrientationLandscapeLeft]; 
    rotated = NO; 
    }