JSail
JSail
  • 发布:2018-03-27 14:26
  • 更新:2018-03-27 15:49
  • 阅读:1715

iOS中弹出键盘后,header会出现错位

分类:MUI
mui

问答区类似问题
具体ui错位的截图参考上面的链接
已解决
1 设置弹出软键盘时自动改变webview的高度

plus.webview.currentWebview().setStyle({  
    softinputMode: "adjustResize"  // 弹出软键盘时自动改变webview的高度  
});

2 增加样式

html, body {  
    height: 100%;  
    margin: 0px;  
    padding: 0px;  
    overflow: hidden;  
    -webkit-touch-callout: none;  
    -webkit-user-select: none;  
}  
  
.mui-content {  
    height: 100%;  
    overflow: auto;   
}
2018-03-27 14:26 1 条评论 负责人:无 分享
已邀请:
无言名

无言名

加上下面的代码试试,我的可以解决

//获取原始窗口的高度
var originalHeight=document.documentElement.clientHeight || document.body.clientHeight;

			window.onresize=function(){  
			  
			    //软键盘弹起与隐藏  都会引起窗口的高度发生变化  
			    var  resizeHeight=document.documentElement.clientHeight || document.body.clientHeight;  
			  
			    if(resizeHeight*1<originalHeight*1){ //resizeHeight<originalHeight证明窗口被挤压了  
			  
			            plus.webview.currentWebview().setStyle({  
			                height:originalHeight  
			            });  
			  
			      }  
			}
  • JSail (作者)

    好像不行


    2018-03-27 17:03

  • 无言名

    好吧,你的是ios系统应该没这问题才对,我无能为力了


    2018-03-28 09:35

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