看如下图片,输入框有时能出现有时被遮挡住,怎么处理可以保证软键盘高度准确呢?
js部分代码
inputFocus: function(t) {
var that = this;
that.setData({
inputFocus: !0,
bottomType: 1, // 原来是0
hight362: t.detail.height + 45 + 40, //t.detail.height键盘软盘高度,45输入框高度,40最后聊天记录和输入框顶部之间高度
});
duration = 980;
that.toViewBottom();
that.setData({
bottom_val: 0,
});
},
wxml部分代码
<view class="chat-tencvi" style="{{sendout?'width:63%;':''}}">
<textarea mode="aspectFill" adjust-position="{{false}}" bindblur="inputBlur" bindfocus="inputFocus" bindinput="bindMsgInput" wx:if="{{!voice}}" focus="{{isInputFocus}}" placeholder="{{inputreminder}}" value="{{inputMsg}}" maxlength="-1"/>
<view bindtouchstart="touchdown" bindtouchend="touchup" wx:if="{{voice}}">按住 说话</view>
</view>
adjust-position="{{true}}"
改下参数就解决了。