Text Input on android phone is not in view when the keyboard for webview comes up?

放肆的年华 提交于 2020-01-24 14:19:09

问题


I have a webview on an android phone that is a registration form and it contains some fields such as first name, last name, user name, password, etc... When focus on the first name input field for example, the keyboard pops up, but the input goes out of view, it still has focus though. Is there a way to keep it in view or is this a bug?


回答1:


This seems to be a problem common to Android applications. The application does not scroll the view such that the input field under focus is visible when the soft keyboard appears. There might be a solution, but it is something you'd have to implement and not a bug (per se).




回答2:


I found this answer here : https://stackoverflow.com/a/5097539/1498996

Add this to your activity tag in the AndroidManifest.xml:

<activity android:windowSoftInputMode="adjustNothing"
      //other flags
/>

It worked for me.



来源:https://stackoverflow.com/questions/4305079/text-input-on-android-phone-is-not-in-view-when-the-keyboard-for-webview-comes-u

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!