Dans chaque UIViewController
, vous devrez remplacer la méthode shouldAutorotateToInterfaceOrientation
et renvoyer une valeur booléenne pour chaque orientation de l'interface que vous soutenez:
// ViewControllerA
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
// ViewControllerB
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait ||
interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
Pour plus d'informations, consultez le UIViewController
class reference.
B ne tournera pas, parce que A est le portrait depuis qu'il a été poussé par un –