[英]iOS: My storyboard is landscape and project is set to landscape but still wrong in simulator
我想制作一个风景iPad应用程序。 我做了以下三件事。 模拟器的方向是风景,这是正确的。 但是,内容错了90度,但它们在情节提要图板视图中是正确的。 我需要检查什么吗?
我将情节提要设置为风景。
可能项目我已经设置了“支持的界面方向” =横向
在视图控制器中也使用了以下代码:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight) return YES; else return NO; }
支持的接口方向是一回事。 在执行以下操作之前,它对我不起作用:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
您必须在所有ViewController上使用以下代码
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight)
}
确保在Info.plist中也设置了“初始界面方向”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.