我正在创建一个仅支持 LANDSDCAPE 模式的 iPad 应用程序。我正在使用 Storyboard。
即使在执行了以下操作之后,当模拟器以横向模式启动时,应用程序仅以纵向模式启动。请帮助我如何使应用程序以横向模式启动并始终保持该模式。
- shouldautorotate 设置为 YES 横向
- info.plist 中的初始界面方向设置为横向
- info.plist 中支持的界面方向设置为横向
- 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/