详细问题描述
示例一:自定义tabBar
page{
width: 100%;
height: 50px;
position: fixed;
botttom: env(safe-area-inset-bottom);
background-color: #108ee9;
}
编译到IOS端,正常显示为:固定在底部安全距离之上的tab条
编译到Android机器,fixed布局失效,悬浮在顶部
示例二:自定义全屏遮罩
page{
width: 100%;
position: fixed;
top: 0;
botttom: env(safe-area-inset-bottom);
background-color: rgba(0,0,0,0.3);
}
编译到IOS端,正常显示为:遮盖除底部安全距离之外的区域,黑色半透明遮罩层
编译到Android机器,没掉,需改为bottom: 0,方可正常显示
【问题】
既然此项安全距离无法通用,条件判断又只能APP-PLUS,无法细致区分Android和IOS,难不成要先写安全距离打包一套到IOS,然后把所有env(safe-area-inset-bottom)再替换为0,再打包到Android???