安卓,textarea被键盘完全遮挡
发布于 5 年前 作者 zhongxiulan 3563 次浏览 来自 问答

以下是官方示列中的代码,给下层加了个高让其在页面底部; cursor-spacing=

的数值等于800左右才能看见输入框,但苹果就挂了

<view class=“container”>

<template is=“head” data="{{title: ‘textarea’}}"/>

<view class=“page-body”>

<view class=“page-section”>

<view class=“page-section-title”>输入区域高度自适应,不会出现滚动条</view>

<view class=“textarea-wrp”>

<textarea bindblur=“bindTextAreaBlur” auto-height />

</view>

</view>

<view class=“page-section” style=‘margin-top:400px;’>

<view class=“page-section-title”>这是一个可以自动聚焦的textarea</view>

<view class=“textarea-wrp”>

<textarea  style=“height: 3em” cursor-spacing=‘20’ />

</view>

</view>

</view>

<template is=“foot” />

</view>

查看官方提问后,加入:

wx.createSelectorQuery().select(’#container’).boundingClientRect((rect) => {

// 使页面滚动到底部  

wx.pageScrollTo({

scrollTop: rect.bottom,//rect.height

duration: 10//设置滚动时间

})

//功能代码

}).exec()

苹果有效,安卓无效

4 回复

遇到同样问题,textarea在页面底部时,真机(华为荣耀)调起键盘后,会把整个textarea遮挡住,请问有解吗?

同求此问题textarea被键盘遮挡,请问有解决的么?同是华为真机复现此问题

类似问题,input 也会遮挡

华为MEAT   8. 完全遮挡,有些机型,第二次后不遮挡,

回到顶部