gpt4 book ai didi

iphone - xcode 4.2.1 - 旋转支持问题

转载 作者:行者123 更新时间:2023-11-29 04:45:52 25 4
gpt4 key购买 nike

我设计了一个应用程序来支持 ios 4.3,并且从“支持的设备方向”中我删除了所有内容,只有纵向处于事件状态。

问题是,当我在手机中模拟该应用程序时,它支持所有方向,而我的应用程序看起来与横向方向不同。

如何强制它不支持横向方向?

最佳答案

在 View Controller 调用中

 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}

强制其不在横向模式下旋转。您还需要确保所有父 View 都具有 autoresizesSubviews = YES。

关于iphone - xcode 4.2.1 - 旋转支持问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9648986/

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