gpt4 book ai didi

iphone - 支持的方向不限制实际方向

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:24:43 26 4
gpt4 key购买 nike

我有一款 iPad 游戏,我只想在横屏模式下观看。我从目标的摘要中选择了横向 View 并有代码

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return YES;
}

在我添加到 navController 的第一个 View Controller 中。但是通过改变目标的方向我能看到的唯一效果不是它如何旋转而是它首先加载的方向。有没有人有任何想法?谢谢!

最佳答案

试试这个:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

关于iphone - 支持的方向不限制实际方向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8332315/

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