我尝试了许多解决方案,如将这些行放入config.xml文件中:
<preference name="ios-orientation-iphone" value="portrait and landscape" />
<preference name="ios-orientation-ipad" value="portrait and landscape" />
<preference name="Orientation" value="default" />
我还在
<platform name="ios">
块内添加了以下代码行:<preference name="Orientation" value="all" />
然后我在我的index.js文件中执行了以下操作:
window.shouldRotateToOrientation = function (degrees) {
return true;
};
最后,我尝试在res/native/ios文件夹中创建自定义的plist文件,因为我注意到生成的plist文件中不包含这些行:
<key>UISupportedInterfaceOrientations</key>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
我不知道接下来该做什么。谢谢。
<preference name="Orientation" value="default" />
- Jordan Burnett