首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >xCode 4.6上的Orientation Landscape iOS 5

xCode 4.6上的Orientation Landscape iOS 5
EN

Stack Overflow用户
提问于 2013-05-02 00:19:51
回答 1查看 1.8K关注 0票数 0

我希望我的应用程序是景观。我尝试了所有的方法,我的故事板的方向是横向的,我在info.plist中改变了支持的方向和初始方向。有谁可以帮我?

在iOS 6模拟器中,它是横向的。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-05-02 02:43:13

在iOS 5中,您需要在每个视图控制器中实现以下方法。

代码语言:javascript
运行
复制
// Called only in IO 5 and earlier.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight ||
            interfaceOrientation == UIInterfaceOrientationLandscapeLeft );
}

并在Info.plist中将UIInterfaceOrientation "Initial interface orientation“设置为UIInterfaceOrientationLandscapeRight

并在横向模式下显示您的视图。

每个Apple's developer docs

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

https://stackoverflow.com/questions/16322056

复制
相关文章

相似问题

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