软键盘挤压导致软键盘上面有块小的布局
如上图,我这里用的是mui-scroll-wrapper区域滚动,占了布局的90%,其余10%就是底部布局
我这里监听了textarea的focus事件,当点击输入框的时候调用下面代码:
var height = document.documentElement.clientHeight || document.body.clientHeight;
var footerHeight=$("#footer").height();
var scrollHeight=$("#wrapper").height();
window.onresize = function() {
var heightView = document.documentElement.clientHeight || document.body.clientHeight;
if(heightView < height) { //原始界面小于弹出后页面的变化 说明软键盘弹出
self.isResize=true;
var scrollHeight=$("#wrapper").height();
$("#wrapper").scrollTop(scrollHeight+10,100);
}else{
self.isResize=true;
$("#wrapper").scrollTop(scrollHeight-10,100);
}
}
弹出软键盘后底部的footer布局也跟着挤压发生了改变,如果隐藏掉,则会留下空白的一小块。
各位大神有人遇到过这个问题吗?请教请教