2

I was wondering how to implement the listview like the android market.

enter image description here

in the right hand panel a listview is divided into the two rows. This is very useful because it saves lot of space and user can look at almost double items in the listview at a time. how can I implement this ? any suggestions?

Ashwani
  • 1,574
  • 14
  • 28

4 Answers4

7

you can use GridView instead of ListView of two columns..

1. GridView

2. GridViewExample

Sample design : enter image description here

SilentKiller
  • 6,944
  • 6
  • 40
  • 75
2

The Android Market also uses the ViewPager to scroll between the pages. Here is an example on how you could implement it.

Tobias Moe Thorstensen
  • 8,861
  • 16
  • 75
  • 143
1

There is another question that is related to this one.Check the folling link, it might help you:

How to display a two column ListView in Android?

Modify you *.xml file to get what you want.

Good luck!

Community
  • 1
  • 1
Iker
  • 2,018
  • 2
  • 29
  • 52
1
  1. If you want to do this using listView, then each item (row) in the list view should consist of two views. You can do this using a relative layout (or linear layout) with two items side by side.
  2. You can also implement this using a gridview having two columns.
rahul
  • 6,447
  • 3
  • 31
  • 42
  • I'll have a look at gridview . But I'll like to know more on how to add two views into the listview. – Ashwani Oct 18 '12 at 08:28
  • Take a look at the following tutorial. http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/ Take a note of how the list_row.xml is laid out. – rahul Oct 18 '12 at 08:40
  • @rahul I don't think that the example that you mentioned is an appropriate example for two-column listview. It implements a custom layout for a listview. And my question is if you implement a two-column listview row than how can you handle the OnItemClick method when the two items are represented as a whole single item. – Aksel Fatih Oct 29 '13 at 14:12