先上图
上图的设置只对手机起作用,iPad需要在Info.plist中单独设置
简单说就是上图中的勾选与Info.plist中的Supported interface orientations中的设置是联动的
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</plist>
IPad设置
Supported interface orientations (iPad)是新的字段,且只能在Info.plist中手动设置
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
</plist>
完整的截图Info.plist各个选项根据需要自行添加
支持全方向
只支持竖屏
在控制器中关闭屏幕旋转
- (BOOL)shouldAutorotate {
return NO;
}
这样你怎么拿着ipad 或者iPhone都会是竖屏的启动图来打开App