如果希望阻止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);

});

相关文章:

  • 2021-11-09
  • 2022-12-23
  • 2021-04-24
  • 2021-05-18
  • 2021-10-05
  • 2021-08-21
  • 2021-12-13
  • 2021-08-06
猜你喜欢
  • 2021-08-11
  • 2021-09-17
  • 2022-12-23
  • 2021-08-01
  • 2021-12-18
  • 2021-11-01
  • 2021-11-20
相关资源
相似解决方案