As pointed out by Falmarri, that isn't a ListView
but a PreferenceActivity
.
If you can't work with the PreferenceActivity
, the simplest way to make a list of different items that will scroll if they out-grow the screen, is to place a ScrollView
around a LinearLayout
. You can read more about it here: http://developer.android.com/reference/android/widget/ScrollView.html
Below is a very simple example:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:text="Some text label here"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<Button
android:text="A button to click"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Perhaps an input field here"
/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:text="Some more text, and a check box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
</LinearLayout>
</ScrollView>
Now this list doesn't contain enough items to scroll, but if you keep adding more elements to it it will start to scroll as soon as it gets bigger than the screen.