问题
This is silly, but if I run phonegap create someApp, and then edit the config.xml file from:
<preference name="orientation" value="default" />
to
<preference name="orientation" value="landscape" />
and run on ios, nothing changes. In fact, its locked in portrait mode. Whats up with this? This is a fresh app, no modifications. Documentation says that this is all there is to it, but it does nothing. Not finding any help anywhere else online... Thanks in advance.
回答1:
Check this http://plugins.cordova.io/#/package/net.yoik.cordova.plugins.screenorientation for possible solution.
I have updated the js/index.js file from the default app:
onDeviceReady: function() {
app.receivedEvent('deviceready');
screen.lockOrientation('landscape'); //this is the new line
},
This is just a workaround as now the app works differently on Android and iOS :(
来源:https://stackoverflow.com/questions/27134485/phonegap-hello-world-change-orientation