1

Unfortunately i have used multiple ListView in single activity. At the moment i am not able to scroll till last ListView as screen height is completely occupied by other ListView's.

Is there any workaround to solve this scroll issue without much code change?.

Please help me solve this problem.

Regards, vishal

Vishal
  • 273
  • 1
  • 4
  • 14

2 Answers2

1

Split them up in separate activities. To me what you described sounds like a design flaw.

Either have Activity A have one ListView, Activity B the other one and so on or create one ListView with the content of all others and separate the content in sections.

Octavian Helm
  • 39,405
  • 19
  • 98
  • 102
-1

EDIT: This design approach does not function reliably across configurations. When I was putting that app together I could not really find anything that indicated the downside of this approach, but here it is for any one following a similar learning path when creating an app that requires a similar design. The SO answer I linked to below is really the best approach for this situation (my opinion).


Sounds like the solution to your problem of multiple ListView's in one Activity is to wrap the entire layout in a ScrollView:

<ScrollView
   . . . >
   <LinearLayout
      . . . >
      <ListView
         android:id="+@id/list_view1"
         . . . />
   </LinearLayout>
   <LinearLayout
      . . . >
      <ListView
         android:id=+@id/list_view2"
         . . . />
   </LinearLayout>
</ScrollView>

Hope this helps to clarify one possible solution, if your design calls for multiple ListView's to be in the same Activity.

See this SO Question/Answer for more detail ( using a bit of a different approach, but this is where I got the idea above).

Community
  • 1
  • 1
Kingsolmn
  • 1,868
  • 2
  • 23
  • 39
  • I have since realized this fact, couldn't really find anything against this approach when I was implementing the design though. I think I'll leave this answer here to help others that are in the same position that I was in. – Kingsolmn May 06 '12 at 13:33