如何从景观开始?

时间:2010-03-23 22:51:40

标签: iphone uikit interface-builder landscape

我已经阅读了一些关于应用程序通过信息文件执行此操作的问题,而不是某个视图。

我只需要设置界面以横向视图开始。

我设法通过shouldAutoRotateToInterfaceOrientation:接近我想要的东西,但它只在旋转视图后才有效。

我对这方面的文档有点新意,所以我可能会在错误的地方找这个。

感谢任何帮助。

2 个答案:

答案 0 :(得分:0)

如果我理解你的问题,你需要:

  1. 编辑项目的info.plist文件
  2. 添加UIInterfaceOrientation属性
  3. 选择其值{UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight}

答案 1 :(得分:0)

这是理论上的,但假设您的shouldAutoRotateToInterfaceOrientation方法中的代码会调整视图以便在给定的界面方向中显示,请在viewDidLoad方法中尝试调用shouldAutoRotateToInterfaceOrientation } {方法UIInterfaceOrientationLandscapeLeftUIInterfaceOrientationLandscapeRight

你说它只在设备旋转时才有效,所以一旦视图加载就手动调用该方法应该可以解决问题。