0

I need a Vertical ListView where each row is a horizontal scrollable list of items. Each items is an image with a button. I need the app to be compatible with Android 2.2.

I've read 3 working solutions here

  1. Use a custom Horizontal ListView as rows

  2. Use a ViewPager as rows ViewPager inside ListView

  3. Use an horizontal ScrollView

These solutions are a bit old and each has their detractors.

So I was wondering, at the current state, is there an "official" solution for my problem? Or, what is the best one?

Community
  • 1
  • 1
Torsen
  • 151
  • 1
  • 7
  • just out of curiosity, why do you need such type of view? – asloob Jan 21 '13 at 12:46
  • It's a request from a customer. They have this kind of view on the iOS version of their app and wants to replicate this behaviour in android. – Torsen Jan 21 '13 at 12:50
  • You have read 3 working solution..But still you have query. There is no such kind of view. If you get cook book solution, i guarantee, your touch event will clash, and it will not work smooth –  Jan 21 '13 at 12:56
  • android has said in its developer's site that it is not advisable to use `Scrollable` view within other `Scrollable` view. – Chintan Rathod Jan 21 '13 at 13:26
  • Ok, i've managed to do the task using a listview and horizontallistview as rows. Using some trick the scroll part works really smooth. I've used a lazyloader for the image and it seems to work fine too. Now i have to understand how to save the position of the rows once you scroll away and then you scroll back to a previous row. – Torsen Jan 21 '13 at 23:26
  • add itemId to your listitem Model class and depending on the value of itemId you can get to know in which row are. – Swati Jan 22 '13 at 05:07
  • the problem was that the setSelection was not implemented in the horizontalListView. – Torsen Jan 22 '13 at 11:42
  • @Torsen I have the same problem as yours. Can you please help me ? – Gaurav Arora Nov 12 '13 at 04:21

1 Answers1

0

If the no of items in the vertical ListView are fixed then you are better off using Horizontal ListViews for each.

asloob
  • 1,308
  • 20
  • 34