gpt4 book ai didi

iPhone - 即使应用程序仅支持纵向,状态栏也会旋转

转载 作者:行者123 更新时间:2023-12-03 21:06:37 25 4
gpt4 key购买 nike

我正在开发一个仅支持纵向的 iPhone 应用程序。在我的设备上一切正常,但在我的测试仪上状态栏自动旋转到横向。 View 的其余部分保持纵向模式。

我的测试仪的设备规范如下:- iPhone 4- 版本 4.2.8

我无法在我的设备(iPhone 4、4.3.3)上重现此错误。

谢谢!

最佳答案

在所有 viewController.m 文件中添加以下函数。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.
return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown); // support only portrait
}

在您的 info.plist 文件中添加以下键

初始界面方向

并将其值设置为“肖像(底部主页按钮)”

干杯。

关于iPhone - 即使应用程序仅支持纵向,状态栏也会旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6490632/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com