if(this.xz){
plus.screen.lockOrientation('landscape-primary')
}else{
plus.screen.lockOrientation('portrait-primary')
}
- 发布:2023-09-16 10:25
- 更新:2024-08-01 17:11
- 阅读:363
产品分类: uniapp/App
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: 12.3.1
HBuilderX类型: 正式
HBuilderX版本号: 3.8.4
手机系统: Android
手机系统版本号: Android 8.1
手机机型: tv
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
if(this.xz){
plus.screen.lockOrientation('landscape-primary')
}else{
plus.screen.lockOrientation('portrait-primary')
}
if(this.xz){
plus.screen.lockOrientation('landscape-primary')
}else{
plus.screen.lockOrientation('portrait-primary')
}
预期结果:
if(this.xz){
plus.screen.lockOrientation('landscape-primary')
}else{
plus.screen.lockOrientation('portrait-primary')
}
if(this.xz){
plus.screen.lockOrientation('landscape-primary')
}else{
plus.screen.lockOrientation('portrait-primary')
}
实际结果:
if(this.xz){
plus.screen.lockOrientation('landscape-primary')
}else{
plus.screen.lockOrientation('portrait-primary')
}
if(this.xz){
plus.screen.lockOrientation('landscape-primary')
}else{
plus.screen.lockOrientation('portrait-primary')
}
bug描述:
开发了一款电视端软件,在电视机上安装都正常,但是在海信电视安装,软件界面就自动翻转过去了。
然后我用一个按钮触发 lockOrientation ,结果无效,在手机端都有效果。
请问这个方法是不是不支持tv端呢?
3 个回复
c***@126.com (作者)
有人遇到这个问题嘛?
1***@qq.com
问题解决了吗?
xzh
https://uniapp.dcloud.net.cn/collocation/manifest.html#app-plus可以配置这个属性screenOrientation
2024-05-15 10:05
1***@qq.com
回复 xzh: 这个我配置了,然后在tv端旋转的时候依然不起作用
2024-05-18 15:03
6***@qq.com
求解,遇到一样的问题