首页 文章

离子cordova-plugin-screen-orientation在Ios上不再起作用

提问于
浏览
2

因为我更新了一切,所以 screen orientation plugin 遇到了一些麻烦 . 我已经有一个运行的应用程序,一切正常 . 但是,由于我将每个插件以及cordova和离子环境更新到最新版本,因此我的屏幕方向插件不再起作用 .

config.xml 配置

<preference name="Orientation" value="portrait"/>

安装插件

cordova-plugin-screen-orientation 1.4.0 "Screen Orientation"
org.adlotto.cordova.recheck-screen-orientation 0.1.0 "RecheckScreenOrientation"

cordova版 6.1.1

离子版 1.7.14

Javascript代码

// to lock screen in portrait mode
screen.lockOrientation('portrait-primary'); // it doesn't work neither with 'portrait'
...
// unlock orientation
screen.unlockOrientation();

屏幕已定义,但函数调用无效 . 我不知道为什么它不再起作用了 . 我用我的Iphone 5(ios 9.2.1)和不同的模拟器试了一下 .

使用我的Android设备,一切都按预期工作 .

1 回答

  • 1

    这看起来像cordova屏幕方向插件的问题 . 它在iOS中用于cordova 6x版本 . 这个问题仍然存在,并且正在进行中 . 请查看此link以获取更多信息 . 根据插件作者的评论,问题修复尚未合并,但如果您感兴趣,可以去git pull测试相同 . 希望能帮助到你 .

相关问题