gpt4 book ai didi

ios - Cordova iOS 横向

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:56:34 27 4
gpt4 key购买 nike

我的 Cordova 应用程序在 iPhone 上运行时从未旋转到横向模式。

我尝试了很多解决方案,将这些行放在 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"> 中 block :

<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>

我不知道接下来要做什么。谢谢

最佳答案

我终于做到了。技巧就是将自定义 .plist 文件放在 res/native//-Info.plist 中。

此链接为我提供了解决方案:Tools for Apache Cordova (VS2015): Adding custom entries to *info.plist for iOS

关于ios - Cordova iOS 横向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35462873/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com