在开发小程序中,自定义导航栏效果很常见,我们直接设置元素固定定位到底部就可以了,例如:
.btn-box{
position:fixed;
width:100%;
left:0;
bottom:0;
height:100rpx;
}
正常这样就可以了,但是。。。。就是有不正常的情况,
在一些手机上底部需要做一下适配
.btn-box{
position:fixed;
width:100%;
left:0;
bottom:0;
height:100rpx;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}