y***@126.com
y***@126.com
  • 发布:2019-09-26 10:20
  • 更新:2019-09-27 18:09
  • 阅读:693

【报Bug】安卓,有密码框时webview高度恢复到原始高度

分类:HBuilderX

在登录页面,有用户名和密码框同时存在时,先点击用户名输入框,整个webview的高度在原始的高度减去软键盘的高度,在点击密码框,webview的高度恢复的原始高度,软键盘只是覆盖在webview上面,而不是顶起(压缩)整个webview;如果单独点密码框,webview的高度是原始的高度上减去软键盘的高度。

<div class="position-box" id="position">  
    <div class="log" id="log-text"></div>  
    <div class="mui-input-group">  
        <div class="mui-input-row">  
            <div class="areaCode-box"></div>  
            <input type="number" v-model.trim="telephone" placeholder="请输入手机号码" style="width: 100%;">  
        </div>  
        <div class="mui-input-row">  
            <div class="code-box"></div>  
            <input type="password" class="input-code" v-model.trim="password" placeholder="请输入密码" style="width: 100%;">  
        </div>  
    </div>  
    <div class="error">{{error}}</div>  
    <div class="btn-login">  
        <span id="login-sign">登录</span>  
    </div>  
</div>  

var oglHeight = document.documentElement.clientHeight || document.body.clientHeight;  
// 判断是否有键盘弹出  
var windowSizeChange = function() {  
       document.getElementById('position').classList.remove('active');  
    if (oglHeight == null) {  
        return false  
    }  
    var tempHeight = document.querySelector("body").offsetHeight;  
    if (oglHeight - tempHeight > 150 || tempHeight - oglHeight > 150) {  
        document.getElementById('position').classList.add('active');  
    } else {  
        document.getElementById('position').classList.remove('active');  
    }  
};
2019-09-26 10:20 负责人:无 分享
已邀请:
y***@126.com

y***@126.com (作者)

有人遇到过这问题吗,2.3.3.20190923的版本,2.1.3.20190723版本还是正常的

该问题目前已经被锁定, 无法添加新回复