2015-09-14 14 views
5

Als Titel frage ich mich, ob es möglich ist, die Ausrichtung programmgesteuert in iOS 9 jetzt sperren? Dies ist wichtig für meine App, aber ich kann keinen Weg finden, dies zu tun. Vielen Dank.Sperre Ausrichtung programmgesteuert in iOS 9

+0

http://stackoverflow.com/questions/26357162/how-to-force-view-controller-orientation-in-ios-8 – GriffeyDog

+0

Laut http://stackoverflow.com/questions/32684922/ios9-alternative-to-uidevice-currentdevice-setvalue-to-force-orientation ist es in iOS 9 nicht möglich. –

Antwort

6

Verwendung supportedInterfaceOrientations und preferredInterfaceOrientationForPresentation verwendet Orientierung zu verwalten beispiels

-(UIInterfaceOrientationMask)supportedInterfaceOrientations{ 
    return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown; 
} 

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{ 
    return UIInterfaceOrientationPortrait; 
} 
+3

nicht für mich –

+0

Ihr Viewcontroller im Inneren funktioniert in NavegationController oder Tabbarcontroller? –

+0

in einem Navigationscontroller, der innerhalb TabbarController ist. –