webview在ios6中显示为旋转,但它显示为ok< = ios 5.1模拟器

时间:2012-10-25 13:14:11

标签: uiwebview ios6 ios5.1

您好,我有一个应用程序,其中我设置支持的界面方向设置为.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中存在另一个问题 - 单击文本框不会调用键盘

2 个答案:

答案 0 :(得分:0)

答案 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];
}