iPad模拟器6.0页面方向无效

San*_*mar 2 xcode orientation ipad ios-simulator cordova

我最近将xcode升级到4.5,安装了iPad 6.0.现在,当我在其中运行PhoneGap html5应用程序时,模拟器内的页面没有旋转,它正在使用早期版本的xcode.当我将模拟器从纵向更改为横向时,应用程序的html页面仍然保留为纵向,它不会随着模拟器旋转到横向.

sir*_*awg 5

这个解决方案对我有用:

编辑AppDelegate.m:

查找:[self.window addSubview:self.viewController.view];

替换为以下代码:

self.window.rootViewController = self.viewController;

如果您仍在显示状态栏,则在内部:MainViewController.m:

之后[super viewDidLoad];

// Do any additional setup after loading the view from its nib.
Run Code Online (Sandbox Code Playgroud)

self.webView.frame = CGRectMake ( 0, 15, self.view.frame.size.width, self.view.frame.size.height-15);
Run Code Online (Sandbox Code Playgroud)

可能不是最好的解决方案,但它对我有用!