html52.com
我爱小程序-开发者交流社区

textarea

问:

textarea聚焦弹起键盘,回车换行后(在最后一行回车),页面与键盘间会多出一层空白,这是为什么?(如下图)

<view style='position: fixed;width: 750rpx;min-height: 100rpx;background-color: red;bottom: 0;margin: 0;'>
  <textarea show-confirm-bar='{{false}}' auto-height='{{true}}' style='background-color: black;margin: 0;position: absolute;bottom: 0;color: white;' cursor-spacing='0'></textarea>
</view>
page {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

}想做微信聊天那样的界面,就是输入框高可变(所以红色那层容器只给了min-height)但低于设置的最大值,整个布局思路可以有什么好的意见想法

想做微信聊天那样的界面,就是输入框高可变(所以红色那层容器只给了min-height)但低于设置的最大值,整个布局思路可以有什么好的意见想法传授一下吗?


特别是键盘弹起的距离,怎样能让他在textarea的下面而不是根据光标?因为textarea有多行而我不想定位光标。


还有一个问题是,换行事件好像有点坑?只有换行后有内容才触发????我丢?


评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付