我正在开发一个只支持纵向的iPhone应用程序。在我的设备上,一切正常,但在我的测试仪上,状态栏自动旋转到横向。视图的其余部分将保持为肖像模式。
我的测试仪的设备规格如下:- iPhone 4- Ver 4.2.8
我无法在我的设备上重现此错误(iPhone 4,4.3.3)。
谢谢!
发布于 2011-06-27 17:17:53
在所有viewController.m文件中添加以下函数。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.
return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown); // support only portrait
}在您的info.plist文件中添加以下密钥
初始界面方向
并将它的值设置为“肖像(底部主页按钮)”
干杯。
https://stackoverflow.com/questions/6490632
复制相似问题