Meteor Cordova Orientation

让人想犯罪 __ 提交于 2020-01-15 15:29:28

问题


I am attempting to lock the orientation of the meteor cordova build to portrait mode.

I have set up a top-level file called mobile-config.js

In that file I included:

App.setPreference('Orientation', 'portrait');

This seems to have no effect, it still switches to landscape mode. Does anyone know how I could implement portrait lock? Thanks!


回答1:


It appears to be an open bug, check this answer here and the bug itself here.

Apparently the simplest way is to edit the Manifest.xml file directly (what comes out of the meteor build command), but I'd use a plugin to avoid having to edit files manually after each build.

Bottom line, to fix it, wait for an official bug fix or meanwhile use a plugin.




回答2:


Not sure if you have fixed it yet. I had a similar issue and resolved it for android app. Please note this solution has been tested for Meteor running on android device using:meteor run android-device. Meteor version is 1.3, also works on 1.3.1. Just stop your meteor server, uninstall the app from android device. Then inside the meteor project directory, meteor reset. Then meteor run android-device.

Let me know if this helps.



来源:https://stackoverflow.com/questions/29574309/meteor-cordova-orientation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!