Jafar Jafar - 1 year ago 126
Android Question

how to make an android view scrollable when the keyboard appears?

I have a view with some fields (name, email, password, register button) :

android:layout_height="fill_parent" >

android:layout_height="wrap_content" >




When I focus an edittext field, the keyboard appears and is overlaying the lower fields on the view. So I can't see them when the keyboard is present. I would like to know how to make the view scrollable so that I can see the lower fields. And additionally, how to make the view scroll automatically to make the focused field visible.

Answer Source

You need to include android:windowSoftInputMode="adjustResize" attribute for your activity in the AndroidManifest.xml file - and then Android should do the resizing for you automatically:

<activity android:name="..."
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download