我正在处理一个需求,要求移动设备只支持竖屏模式,而平板电脑/iPad则支持横屏和竖屏模式。我不确定如何在react-native中实现这个需求。
我正在处理一个需求,要求移动设备只支持竖屏模式,而平板电脑/iPad则支持横屏和竖屏模式。我不确定如何在react-native中实现这个需求。
对于 iOS,将以下行添加到 ios/Info.plist
文件中即可:
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>