Skip to content Skip to sidebar Skip to footer

Android Listactivity Scrollview How To Get A List To Scroll

I was going through a tutorial on http://www.vogella.de/articles/AndroidListView/article.html learning how to do use ListActivity. I am trying to get the list to scroll, but came t

Solution 1:

the ListView is itself a scrolling widget, so it can't be used inside of a ScrollView

Solution 2:

You don't need an additional ScrollView. The ListActivity or to be precise the ListView is scrollable by default if there are more items to draw then space is available.

By the way, one should avoid the combination of ScrollViews and ListViews there are couple of problems to consider and you don't need it for your solution, either.

Solution 3:

List view it's self scrolling. if you want to set scrolling layout you can use this code This is work for you.

<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"android:id="@+id/lwidget36"android:layout_width="fill_parent"android:layout_height="fill_parent"android:layout_above="@+id/lwidget35"android:background="#000321"android:overScrollMode="never" >

<LinearLayout 
android:layout_width="wrap_content"android:layout_height="wrap_content" >

<ImageView
android:id="@+id/icon"android:layout_width="22px"android:layout_height="22px"android:layout_marginLeft="4px"android:layout_marginRight="10px"android:layout_marginTop="4px"android:src="@drawable/ic_launcher" >
</ImageView>

<TextView
android:id="@+id/label"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="@+id/label"android:textSize="20px" >
</TextView>

</LinearLayout>
</ScrollView>

Post a Comment for "Android Listactivity Scrollview How To Get A List To Scroll"