1. 属性
(1)竖屏(手机正常方向)
plus.screen.lockOrientation("portrait-primary");
(2)横屏(默认)
plus.screen.lockOrientation("landscape-primary");
(3)反向横屏
plus.screen.lockOrientation("landscape-secondary");
(4)解除锁定(跟随系统自动旋转)
plus.screen.lockOrientation("default");
2. 注意事项
只能在 App 端运行
必须在 plus ready 后调用
onReady(){#ifdef APP-PLUS// 锁定横屏plus.screen.lockOrientation("landscape-primary");#endif},onUnload() {#ifdef APP-PLUS// 恢复竖屏plus.screen.lockOrientation("portrait-primary");#endif}
夜雨聆风