首页
学习
活动
专区
圈层
工具
发布

自转iOS6
EN

Stack Overflow用户
提问于 2013-01-05 16:03:27
回答 2查看 431关注 0票数 0

可能重复: How to make app fully working correctly for autorotation in iOS 6?

在iOS6中有自转的问题。我在中添加了以下内容:

代码语言:javascript
复制
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    return (UIInterfaceOrientationMaskAll);
}

并在中添加了以下内容:

代码语言:javascript
复制
- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return (UIInterfaceOrientationMaskPortrait);
}

我还是不能让它成为肖像,而不是风景!帮助是非常感谢的。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-01-05 16:57:27

您不需要在App对象中设置接口方向。在中选择您的项目文件。然后选择目标并选择Summery。在这里,您可以选择支持的接口方向。这适用于整个项目。

票数 1
EN

Stack Overflow用户

发布于 2013-01-05 16:34:15

仅将其粘贴到ViewController:

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

删除shouldAutorotateapplication:supportedInterfaceOrientationsForWindow:

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

https://stackoverflow.com/questions/14173558

复制
相关文章

相似问题

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