You can wrap the widget inside a ScrollView. Here is a simple example:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/txt"/> </LinearLayout> </ScrollView>
If you want to do this in code:
ScrollView sv = new ScrollView(this);
source share