i ont UIView avec un uiviewtablecontroller ajouté en tant que sous-vue, mon appareil démarre en mode paysage, mais tableviewcontroller est toujours en mode portraitUIView changement d'orientation programme
0
A
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;
}