项目启动 摆放横屏或竖屏 转屏项目不变
- 固定其呈现方向 -
1 首先选择支持的旋转方向:
2 在启动页面添加限制:
上面的只能显示一个方向
下面的代码限制为横屏正着和倒着
- (BOOL)shouldAutorotate
{
return
YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
[self
shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationMaskLandscapeLeft |
UIInterfaceOrientationMaskLandscapeRight];
return
UIInterfaceOrientationMaskLandscapeLeft |
UIInterfaceOrientationMaskLandscapeRight;
}
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {
return YES;
}else{
return NO;
};
}