Android webview中隐藏在键盘下方的文本框 [英] Textbox hidden below keyboard in Android webview

查看:35
本文介绍了Android webview中隐藏在键盘下方的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个简单的 iPhone/Android 应用程序,其中包含一个普通的 web 视图.此网络视图称为我的网站.

I have created a simple iPhone/Android app, containing a normal webview. This webview calls my website.

在我的网站上有几种输入类型=文本或文本区域的表单.当它们位于页面底部时,我遇到了问题!

On my website there are several forms with input type=text or textarea. I have a problem with those when they are at the bottom of the page!

1) 在我的 iPhone 应用中,键盘会自动出现并将文本框推送到手机屏幕的可见区域.所以没什么可做的.

1) In my iPhone app, the keyboard will automatically appear and push the textbox to the visible area of the phone screen. So there is nothing to do.

2) 但在我的 Android 应用程序中,文本框将保留在同一个位置,并最终被我的键盘隐藏.所以用户唯一的选择就是输入blind".

2) But in my Android app the textbox will stay at the same place and is eventually hidden by my keyboard. So the only option users have is to type "blind".

我该如何解决这个问题?有其他人遇到过这个问题吗?

How can I fix this? Did anyone else meet this problem?

推荐答案

我就是这样解决问题的.正如文基所说,你必须添加

This is how I solved the problem. As Venky said, you have to add

android:windowSoftInputMode="adjustResize"

到您在 AndroidManifest.xml 文件中的标记.但在我们的案例中,这还不够.确保您对视图、网络视图等也执行此操作.然后我们终于让它起作用了.

to your tag in the AndroidManifest.xml file. But in our case, it wasn't enough. Make sure you do this as well with your views, webviews etc. Then we finally made it work.

这篇关于Android webview中隐藏在键盘下方的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆