this.windowResize = ( res ) => {
this.landscapeScreen = res.deviceOrientation == 'landscape'
}
uni.onWindowResize( this.windowResize )
产品分类: uniapp/H5
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: 版本 Windows 11 专业工作站版 Insider Preview 版本号 23H2 安装日期 2023/11/3 操作系统版本 25987.1000 体验 Windows Feature Experience Pack 1000.25987.1000.0
HBuilderX类型: 正式
HBuilderX版本号: 3.96
浏览器平台: 微信内置浏览器
浏览器版本: 未知
项目创建方式: HBuilderX
this.windowResize = ( res ) => {
this.landscapeScreen = res.deviceOrientation == 'landscape'
}
uni.onWindowResize( this.windowResize )
this.windowResize = ( res ) => {
this.landscapeScreen = res.deviceOrientation == 'landscape'
//ios横屏等于false(portrait)
}
uni.onWindowResize( this.windowResize )
this.windowResize = ( res ) => {
this.landscapeScreen = res.deviceOrientation == 'landscape'
//ios横屏等于true(landscape)
}
uni.onWindowResize( this.windowResize )
this.windowResize = ( res ) => {
this.landscapeScreen = res.deviceOrientation == 'landscape'
//ios横屏等于false(portrait)
}
uni.onWindowResize( this.windowResize )
this.windowResize = ( res ) => {
this.landscapeScreen = res.deviceOrientation == 'landscape'
}
uni.onWindowResize( this.windowResize )
this.landscapeScreen如果处于横屏时应该是true,但是在ios端是false,测试了一下在电脑和安卓看是正常的当横屏deviceOrientation 等于"landscape",但是在ios横屏返回的"portrait",竖屏返回的是 "landscape",就是完全反过来了
0 个回复