webview键盘自适应_Android webview键盘覆盖输入

本文介绍了在Android Cordova应用中使用WebView遇到的问题,即当用户点击输入框打开键盘时,键盘会遮挡输入框而不会将其推上去。通过设置`android:windowSoftInputMode="adjustPan"`防止屏幕缩放,同时尝试通过CSS调整输入框位置。最终解决方案是监听键盘显示/隐藏事件,根据键盘高度动态调整输入框的Y轴位置,确保输入框始终可见。
摘要由CSDN通过智能技术生成

The desired effect for my android application is to have a webview with an input box and content. When the user clicks on the keyboard, the keyboard pushes the input box up, but does not resize the main content and just overlays ontop of it as seen in the diagram below.

The problem I'm experiencing is that the keyboard covers the input box and does not push it up.

This is currently a cordova android application. In the manifest, I have configued

Also in the config.xml:

I used android:windowSoftInputMode="adjustPan" to prevent the screen from resizing which is what i want since I don't want the content to be squished. I've also tried configuring the css for the input box to be fixed and absolute (basically tied to the bottom of the webview.

From my understanding, when the keyboard pops up from

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值