详细问题描述
第一次调转到横屏页面,样式正常,返回在重新打开当前横屏页面,设置的图标变大了,跟着有些其他页面样式也对应变大了,详见附件那个返回按钮。安卓手机没有问题
页面代码
<!-- -->
<template>
<view class='star' :style="{width:width ,height: height}">
<text class="my-icon back" @tap="tapBack"></text>
<image @tap="tapImage" :style="{width:width ,height: height}" src="/static/test/timg.gif" mode="scaleToFill" ></image>
</view>
</template>
<script>
export default {
data() {
return {
width:'667px',
height:'375px'
}
},
onLoad() {
let that = this;
let systemInfo=this.$store.state.systemInfo;
console.log(systemInfo);
// #ifdef APP-PLUS
plus.screen.lockOrientation("landscape-primary");
// #endif
},
onUnload() {
console.log('监听页面卸载')
// #ifdef APP-PLUS
plus.screen.unlockOrientation();
plus.screen.lockOrientation("portrait-primary");
// #endif
},
/**
* 计算属性
*/
computed: {
},
methods: {
/**
* 返回
*/
tapBack() {
console.log('返回')
//uni.navigateBack()
},
tapImage(){
console.log('图片')
}
}
}
</script>
<style lang="scss" scoped>
.star{
overflow: hidden;
}
.back {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
width: 58upx;
height: 58upx;
border-radius: 20upx;
background: #eee;
z-index: 10;
color: #ababab;
left: 20upx;
top: 10upx;
font-size: 32upx;
}
</style>
小喽啰
大佬 请问这个问题后面有解决?
2020-08-12 17:59
wppeng (作者)
回复 小喽啰: 延时1300毫秒之后执行横屏,出现的次数就不会太频繁了
2020-08-18 16:48
小喽啰
回复 wppeng: 谢谢 我后面改为样式实现了,将页面旋转90度
2020-08-20 18:04