Lei Guo
Lei Guo

Reputation: 2560

How to avoid the Input Method hiding the EditText and Button at the bottom of a WebView

I load a web page by using WebView in my app and there are EditText and Button at the bottom of the page. When I press the EditText, the soft input method will show, but the input method hides the EditText and Button.

I want the EditText and Button move to the top of the input method, so the input method won't hide them.

I added the android:windowSoftInputMode="adjustPan" to my activity tag in the AndroidManifest.xml, but it didn't work.

What else can I do?

Upvotes: 0

Views: 1384

Answers (2)

Harneet Kaur
Harneet Kaur

Reputation: 4497

Rather than using adjustPan property,Try using following property.It works fine for me..

        android:windowSoftInputMode="adjustResize"

Upvotes: 1

Awais Tariq
Awais Tariq

Reputation: 7754

Try to put your webview in ScrollView layout. Once keyboad will appear the scroll layout will move upwards. Remember you can have only one child in ScrollView layout. Better put some Layout like Linear or Relative in Scrollview then add other child views in that layout.

Take a look at these:

Scrollview vertical and horizontal in android

http://www.androidaspect.com/2012/02/scrollview-tutorial-android-ui.html

Upvotes: 0

Related Questions