Ios6 在iOS 6中手动更改方向

Ios6 在iOS 6中手动更改方向,ios6,Ios6,我在iOS 5中手动更改方向,一切正常。但在iOS 6中,键盘没有更改方向。UIApplication statusBarOrientation不工作。尝试以下操作: - (UIInterfaceOrientationMask)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } 与此相反: - (BOOL)shouldAutorotateToInterfaceOrientation

我在iOS 5中手动更改方向,一切正常。但在iOS 6中,键盘没有更改方向。UIApplication statusBarOrientation不工作。

尝试以下操作:

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskLandscape;
}
与此相反:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
更新:

在iOS 7 SDK和Xcode 5中:

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskLandscape;
}

方法
statusBarOrientation
仅在
supportedInterfaceOrientations
回调返回0时有效。要使以前的代码正常工作,可以在调用
statusBarOrientation
方法之前将标志设置为true。调用
statusBarOrientation
后,可以重置此标志

当您发现此标志为真时,可以从
supportedInterfaceOrientations
返回0