ipad - Storyboard ipad 仅横向

标签 ipad storyboard landscape

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

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

  1. shouldautorotate 设置为 YES 横向
  2. info.plist 中的初始界面方向设置为横向
  3. info.plist 中支持的界面方向设置为横向
  4. View Controller 的模拟指标设置为推断。

在此先感谢您的帮助。我在网上搜索过,但没有找到答案。

最佳答案

在模拟指标下选择“横向”。

还要确保你的 View Controller 实现中有这个方法:

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

关于ipad - Storyboard ipad 仅横向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9355810/

相关文章:

ios - Xcode 7 : set top constraint for CollectionView for iPhone 6S plus

iPhone iOS 6 UITabBarController 仅纵向,如何让模态视图 Controller 支持横向方向

iphone - 仅横向具有多个 Nib 的 iPhone 应用程序

objective-c - NSDateFormatter 生产(空)SQLite 和 iOS 5.1

iphone - 如何确定 iphone/ipad/ipod/appletv 是旧的、更新的还是与同一系列的其他设备相同?

iphone - 谁能给我解释一下 iPhone 中字典的实际结构?

ios - 初始 ViewController 根据 Storyboard中的登录更改

ios - 如何在加载的早期阶段在 iOS 中使用 Storyboard实例化特定的 View Controller ?

ios - 分组的 UITableView 和水平边距

ios - ECSlidingViewController 在设备方向变为横向时隐藏