我正在使用Android Studio的webview开发聊天。每次选择输入文本时,键盘打开都会调整输入文本及其div的大小。我已将清单配置为:
android:windowSoftInputMode="adjustResize"
已经尝试过:
android:windowSoftInputMode="adjustPan"
我想,当键盘打开时,输入文本和div不会调整大小并保持原始大小。
HTML:
<body>
<div class="campoCorpo">
<div class="wrapMsg">
</div>
<div class="divMsg">
<div class="alinhar">
<input type="text" id="msgUsuario" class="inp">
<div class="btnOk">
</div>
</div>
</div>
</div>
</body>
CSS:
.wrapMsg{
background-color: #f9f9f9;
position: relative;
height: 83%;
width: 90%;
top : 2%;
left: 3%;
border: 1px solid #b7b7b7;
border-radius: 3px;
padding: 2% 2% 2% 2%;
overflow: scroll;
}
.divMsg{
position: relative;
background-color: #1098F7;
height: 11%;
width: 94%;
bottom: 1%;
left: 3%;
display: table;
border : 1px solid #4C6085;
border-radius: 3px;
}
.inp{
margin-left: 1%;
width: 82%;
height: 75%;
}
.alinhar{
vertical-align: middle;
display: table-cell;
}
input[type="text"]{
border:0;
outline: 0;
border-radius: 3px
}
.btnOk{
position: relative;
width: 14%;
height: 75%;
background-color: #4C6085;
float: right;
margin-right: 2%;
border-radius: 3px;
}
.campoCorpo{
position: absolute;
width: 100%;
height: 100%;
background-color: #efefef;
z-index: 0;
}