用page-container做底部弹出,加上textarea做输入,结果弹出的软键盘会覆盖掉部分弹出层,曲线救国,当textarea获取/失去焦点是得到键盘高度,重设弹出层距底部距离,但是谁曾想获取的键盘高度明显高于实际值?自此无解了
<page-container
show="{{show}}"
round="{{round}}"
overlay="{{overlay}}"
duration="{{duration}}"
position="{{position}}"
close-on-slide-down="{{false}}"
custom-style="margin-bottom:{{keyboardheight}}px"
overlay-style="{{overlayStyle}}"
bindenter="onEnter"
>
<view class="detail-page">
<textarea class="pop-textarea" focus="{{focus}}" auto-focus="{{true}}" adjust-position="{{true}}"
show-confirm-bar="{{false}}" bindkeyboardheightchange="keyboardchange" placeholder="评论一下"/>
</view>
<view class="detail-button">
<view class="plbtn"> 按钮 </view>
</view>
</page-container>
比实际值高出一倍,有没有哪位大佬有解决办法
wx.onKeyboardHeightChange((result) => {
this.setData({keyboardheight:result.height/2})
})
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
你这个页面应该有tabbar,他算了tabbar的高度