故事板ipad仅在横向方向

时间:2012-02-20 03:24:36

标签: ipad storyboard landscape

我正在创建一个仅支持LANDSDCAPE模式的iPad应用程序。我正在使用故事板。

即使在执行以下操作后,当模拟器以横向模式启动时,应用程序仅以纵向模式启动。请帮助我如何使应用程序以横向模式启动并始终保持该模式。

  1. shouldautorotate设置为风景
  2. info.plist中的初始界面方向设置为横向
  3. info.plist中支持的界面方向设置为横向
  4. 将视图控制器的模拟指标设置为推断。
  5. 提前感谢您的帮助。我在网上搜索过但是没有答案。

1 个答案:

答案 0 :(得分:6)

在模拟指标下选择“风景”。

还要确保在视图控制器实现中使用此方法:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}