2

In one of my activities I am showing certain information and at the end I have a ListView. So my layout looks a bit like:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="30dip"
>
  ...
  <ListView android:id="@android:id/android:list" android:layout_width="wrap_content"
        android:layout_height="fill_parent" />

</LinearLayout>

When I run the application in the emulator I see that the information before the list view is always shown in the screen and there is a vertical scroll for the ListView only.

Is there a way to change this scrolling behaviour ?. What I would like to have is a vertical scroll for all the information in the screen, not only at the level of the ListView.

I tried wrapping the LinearLayout with a ScrollView, with different combinations of the android:layout_height attribute for all the views involved but I did not get the effect that I was looking for. Besides, some people say that it is a pretty bad idea to wrap a ListView with a ScrollView :

Android ScrollView layout problem

Scrolling with Multiple ListViews for Android

Thanks for any other ideas.

Community
  • 1
  • 1
Sergio
  • 8,532
  • 11
  • 52
  • 94
  • You may want to reconsider how your layout is set up. For instance you might add whatever it is thats above the ListView to the list view as the first (and second etc.) items – ghostbust555 Jan 26 '12 at 03:38

1 Answers1

0

I've not tried this, but you might want to look at you tube video: Google I/O 2010 - The world of ListView

http://www.youtube.com/watch?v=wDBM6wVEO70

Starting at time 27:11, it talks about how to make info above and/or below a ListView scroll with the ListView. It refers to scrolling headers and footers, but it does say you can put anything you want in them.

Arlene K
  • 253
  • 2
  • 6