How can I scroll while the keyboard is open in Android?

I have a row of edittext in a scrollview and when they exceed the screen bandwidth it is difficult to smoothly scroll when the keyboard is open. Here is my code.

     <ScrollView 
   android:layout_width="match_parent"
   android:layout_height="match_parent"
    >
    <LinearLayout 
        android:layout_width="match_parent"
        android:layout_height="wrap_content" 
        android:orientation="vertical"   
    >
        <EditText 
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            />
        <EditText 
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            />
        <EditText 
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            />
        <EditText 
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            />
        <EditText 
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            />
    </LinearLayout>
</ScrollView>

      

I ask you to consult a good link to this problem or answer it if anyone knows.

thank

+3


source to share


2 answers


use

 android:focusable="true" 
        android:focusableInTouchMode="true"

      



inside linearlayout.

+2


source


Place android:windowSoftInputMode="adjustResize"

in your activity tag in your manifest file.



It will work.

+3


source







All Articles