Search code examples
androidandroid-layoutandroid-scrollviewandroid-keypad

How I can do scroll in view while keypad is open in android?


I have a number of edittext in scrollview and when they exceed the screen capacity, it is difficult to perform smooth 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>

Please guide me with a good link to this problem or answer the same if anybody knows.

Thanks


Solution

  • use

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

    inside linearlayout.