首页 > 编程知识 正文

android设置底部距离

时间:2023-05-03 17:03:13 阅读:261722 作者:3162

详细问题描述

示例一:自定义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???

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。