您好,我有一个应用程序,其中我设置支持的界面方向设置为.plist文件中的横向(左主页按钮),横向(右主页按钮)
并在testviewcontroller.m文件中
我有代码: -
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
我必须做些什么更改才能在ios6模拟器上显示正常
由于
找到答案: -
if ([[UIDevice currentDevice].systemVersion floatValue] < 6.0)
{
// how the view was configured before IOS6
[self.window addSubview: navigationController.view];
[self.window makeKeyAndVisible];
}
else
{
// this is the code that will start the interface to rotate once again
[self.window setRootViewController: self.navigationController];
}
来自此链接 -
IOS 6 force device orientation to landscape
但现在ios6中存在另一个问题 - 单击文本框不会调用键盘
答案 0 :(得分:0)
https://developer.apple.com/library/prerelease/ios/#releasenotes/General/RN-iOSSDK-6_0/_index.html
UIKit部分介绍了如何在iOS6中进行旋转。
答案 1 :(得分:0)
if ([[UIDevice currentDevice].systemVersion floatValue] < 6.0)
{
// how the view was configured before IOS6
[self.window addSubview: navigationController.view];
[self.window makeKeyAndVisible];
}
else
{
// this is the code that will start the interface to rotate once again
[self.window setRootViewController: self.navigationController];
}