1、添加插件
cordova plugin add net.yoik.cordova.plugins.screenorientation
2、添加屏幕配置 (Config.xml文件里面添加)
<preference name="orientation" value="portrait" />
3、在Index.html 界面 添加JS 屏幕监听事件
<script>
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady()
{
var so = cordova.plugins.screenorientation;
so.setOrientation(so.Orientation.LANDSCAPE);
}
</script>
禁止APP 横屏 完成