手机进入时直接是横屏,可以这样设置:
onShow() {
//#ifdef APP-PLUS
plus.screen.lockOrientation('landscape-primary');
//#endif
},
onUnload() {
//#ifdef APP-PLUS
plus.screen.lockOrientation('portrait-primary');
//#endif
},
如页面是使用upx或rem等单位,可能会导致样式错乱。
解决方法:
- 可在进入横屏页面后,1300毫秒后再横屏
- 可不使用横屏操作,用样式旋转页面90度,达到横屏操作