//第一种方式在需要设置安全区域的盒子模块上使用css方法
padding-bottom: 0;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
//第二种方式通过uniapp的原生方法需要注意uniapp原生函数的this指向的是他本身需要用箭头函数 或者直接是同变量储存this再使用:style行内式 :style={bottom:'safeBottom'+'rpx'}固定定位的方式
getBottomHeight() {
uni.getSystemInfo({
//获取底部导航烂高度
success: (info) => {
// 获取安全区域的底部高度
this.safeBottom = info.safeAreaInsets.bottom;
},
});
},
03-01
2432
08-30
1137
02-15
6020
09-24
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交