好像是因為uniapp使用rpx原因,但是搞不懂為什么其他頁面會錯亂
解決辦法,設置橫屏的時候,做一個1.2s的延遲在執行
//頁面顯示時切換為橫屏配置 onShow() { // #ifdef APP-PLUS uni.showLoading({ title: "加載中..." }) setTimeout(() => { plus.screen.unlockOrientation(); plus.screen.lockOrientation('landscape-primary'); uni.hideLoading(); }, 1200) //#endif }, //頁面卸載時切換為豎屏配置 onUnload() { // #ifdef APP-PLUS plus.screen.lockOrientation('portrait-primary'); //鎖死屏幕方向為豎屏 // #endif },