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
Antwort
Verwendung supportedInterfaceOrientations und preferredInterfaceOrientationForPresentation verwendet Orientierung zu verwalten beispiels
-(UIInterfaceOrientationMask)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
return UIInterfaceOrientationPortrait;
}
nicht für mich –
Ihr Viewcontroller im Inneren funktioniert in NavegationController oder Tabbarcontroller? –
in einem Navigationscontroller, der innerhalb TabbarController ist. –
http://stackoverflow.com/questions/26357162/how-to-force-view-controller-orientation-in-ios-8 – GriffeyDog
Laut http://stackoverflow.com/questions/32684922/ios9-alternative-to-uidevice-currentdevice-setvalue-to-force-orientation ist es in iOS 9 nicht möglich. –