如何在XCode 4 Interface Builder中将窗口方向更改为横向? [英] How can I change a window orientation to landscape in XCode 4 Interface Builder?

查看:106
本文介绍了如何在XCode 4 Interface Builder中将窗口方向更改为横向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很欣赏我可能会遗漏一些基本的东西,但是......

I appreciate I'm probably missing something basic here, but...

我的iPad应用程序只支持横向模式,并且有一个MainWindow.xib窗口我想在XCode 4中以横向模式工作,但是用于更改此模式的下拉菜单(模拟指标 - >方向)始终显示为灰色。

My iPad app will only support landscape mode, and has a MainWindow.xib Window that I'd like to work on in landscape mode in XCode 4, however the pull-down menu to change this (Simulated Metrics -> Orientation) is always grayed out.

我注意到视图可以旋转得很好,只有Windows无法使用此设置在XCode 4中旋转。

I notice that Views can be rotated just fine, it's only Windows that can't be rotated in XCode 4 using this setting.

是否有解决方法,或者做我必须在MainWindow顶部放置一个View来旋转它吗?

Is there a workaround for this, or do I have to put a View on top of the MainWindow in order to rotate it?

推荐答案

我认为这是因为应用程序总是启动在纵向,然后旋转到适当的oriantations。从 UIViewController docs:

I think it's because apps always starts up in portrait and then rotates to appropriate oriantations. From the UIViewController docs:


注意:在启动时,应用程序应始终设置以纵向方向设置
界面。在
应用程序:didFinishLaunchingWithOptions:方法返回之后,
应用程序使用上面描述的视图控制器旋转机制
将视图旋转到显示窗口的
之前的适当方向。 / p>

Note: At launch time, applications should always set up their interface in a portrait orientation. After the application:didFinishLaunchingWithOptions: method returns, the application uses the view controller rotation mechanism described above to rotate the views to the appropriate orientation prior to showing the window.

所以你需要 UIViewController 魔法来模拟指标来制作任何感。如果您使用基于窗口的应用程序模板作为项目的起点,请尝试使用基于视图的应用程序模板。

So you'll need the UIViewController magic for the simulated metrics to make any sense. If you used the "Window-based application" template as a starting point for your project try the "View-based application" template instead.

这篇关于如何在XCode 4 Interface Builder中将窗口方向更改为横向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆