IONIC屏幕方向锁定
如果希望阻止app在设备旋转时发生横屏,可以使用这个插件:
cordova plugin add cordova-plugin-screen-orientation
// set to either landscape
screen.lockOrientation('landscape');
// allow user rotate
screen.unlockOrientation();
window.addEventListener("orientationchange", function()
{
console.log('Orientation changed to ' + screen.orientation);
});