帖子
帖子
用户
博客
课程
显示全部楼层
6
帖子
0
勋章
52
Y币

[superwebview] 安卓端的刘海屏怎么适配

[复制链接]
发表于 2019-10-16 18:18:29
本帖最后由 ZMPSophia 于 2019-10-16 18:22 编辑

加这个也没什么用,$api.fixStatusBar(header)这个也没什么用,请问还有什么解决方式么?
截图1.png
6
帖子
0
勋章
52
Y币
目前是这样
aaaa.jpg
42
帖子
4
勋章
1万+
Y币
42
帖子
4
勋章
1万+
Y币
header你看下是不是css固定了高度??最大问题自己代码写法问题
6
帖子
0
勋章
52
Y币
Mr.ZhouHeng 发表于 2019-10-16 18:20
https://docs.apicloud.com/Dev-Guide/iPhoneX-adaptation

只有中间那个dom移动了,其他的还是没动
bbbb.png
42
帖子
4
勋章
1万+
Y币
    .header {
            position: relative;
            height: 44px;
            background-color: #06091C;
            color: #fff;
        }

        .header .left {
            position: absolute;
            width: 44px;
            height: 44px;
            left: 0;
            bottom: 0;
            background-image: url('../../image/strategy/back.png');
            background-repeat: no-repeat;
            background-size: 20px 20px;
            background-position: 8px center;
        }

        .header .center {
            position: absolute;
            width: 60%;
            height: 44px;
            left: 20%;
            bottom: 0;
            font-size: 20px;
        }

        .header .right {
            position: absolute;
            height: 44px;
            right: 0;
            bottom: 0;
            font-size: 14px;
            padding: 0 12px;
        }


<header class="header">
        <div class="left" tapmode onclick="fnCloseWin()"></div>
        <div class="center v2-flex-center">
            发微博
        </div>
        <div class="right v2-flex-center-v display-none" tapmode onclick="fnClickRight()">
            发布
        </div>
    </header>
  apiready = function() {
        fixStatusBar();
}

//修复沉浸式头部高度
function fixStatusBar() {
    var el = document.querySelector('header');
    if (!el) {
        return;
    }
    el.style.paddingTop = api.safeArea.top + 'px';
    window.headerHeight = el.offsetHeight; // 获取header高度
}


6
帖子
0
勋章
52
Y币
Mr.ZhouHeng 发表于 2019-10-16 18:27
.header {
            position: relative;
            height: 44px;

感谢,可以解决了
您需要登录后才可以回帖 登录

本版积分规则