实现小程序iphonex与iphone6底部适配
时间:2020-11-28 14:32:43
收藏:0
阅读:116
实现iphonex与iphone6底部适配
- 给底部要绝对定位的按钮或者组件添加
height: 80px; // 底部组件高度
position: fixed;
left: 0;
bottom: 0;
right: 0;
padding-bottom: calc(constant(safe-area-inset-bottom));
padding-bottom: calc(env(safe-area-inset-bottom));
- 给上边的内容区域添加
// +的是底部组件高度
padding-bottom: calc(constant(safe-area-inset-bottom) + 80px);
padding-bottom: calc(env(safe-area-inset-bottom) + 80px);
原文:https://www.cnblogs.com/Huskie-/p/14052315.html
评论(0)