首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ios6.0中的UIInterfaceOrientation

ios6.0中的UIInterfaceOrientation
EN

Stack Overflow用户
提问于 2012-09-14 14:40:59
回答 2查看 1K关注 0票数 1

我正在开发box2d游戏。我的游戏uiinterfaceOrientation是UIInterfaceOrientationLandscapeLeft,它在ios5.1下运行良好,但是ios6.0我遇到了界面定向问题。我知道- shouldAutorotateToInterfaceOrientation:在iOS 6.0中不推荐使用。对于interfaceOrientation,它们给出了类似的接口方向设置,toUIInterfaceOrientationMaskAll用于iPad习惯用法,UIInterfaceOrientationMaskAllButUpsideDown用于iPhone习惯用法。我不知道如何使用这个(UIInterfaceOrientationMaskAll)。我需要在UIInterfaceOrientationLandscapeLeft里玩游戏。你能告诉我如何解决这个问题吗?谢谢..

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-09-14 22:54:32

Here is a link to a blog about the new functions.

对于您的需求,您需要添加的全部内容是:

代码语言:javascript
复制
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscapeLeft;}

这将使它只允许您运行景观左。

票数 2
EN

Stack Overflow用户

发布于 2012-09-17 17:45:20

此外,还应该在UISupportedInterfaceOrientations中添加UIInterfaceOrientationLandscapeLeft,并在Info.plist中添加UIInterfaceOrientation属性。您还可以通过从shouldAutorotate回调中明确返回false来阻止进一步的自动旋转。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12419347

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档