Android Question need help with listview

apty

Active Member
Licensed User
Longtime User
Kindly assist with a code to display the listview as shown below
HTML:
Item  Description  Date  Amount
A        XX        XX      XX    
B        XX        XX      XX
 
Last edited:

eps

Expert
Licensed User
Longtime User
ListView doesn't really work well for that sort of data layout, unless all of the rows are a single ListView.

I would recommend CustomListView or ScrollView. ScrollView is a lot more fiddly and you need to manage the heights and starting heights of items in it, but once set up it works well. I've put together a ScrollView for this App : https://play.google.com/store/apps/details?id=torquesoft.lemanslivetiming

You also need to consider if you want the Headings to remain on View, there is also TableView which might suit your needs. This has an extra benefit of 'knowing' about the headings and handling them for you.

It also depends on the number of elements you are planning on having in the list and possibly graphical items or even controls such as checkboxes / tick boxes.

I would look at the following :


TableView

http://www.b4x.com/android/forum/threads/class-tableview-supports-tables-of-any-size.19254/ and also an improved version : http://www.b4x.com/android/forum/threads/class-flexible-table.30649/


ScrollView

http://www.b4x.com/android/forum/threads/scrollview-examples-summary.8423/


and CustomListView (based on ScrollView)

http://www.b4x.com/android/forum/th...ew-a-flexible-list-based-on-scrollview.19567/

HTH
 
Upvote 0

apty

Active Member
Licensed User
Longtime User
What about displaying it as below?
Item A
Description
Date
Amount

Item B
Description
Date
Amount

Is this possible in listview?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Yes but you cannot set different layout for the lines.

ALL TWO-Line-Items have the same layout.
ALL ONE-Line-Items have the same layout.
ALL Two-Line-Items with Bitmap have the same layout.

In fact you must define each of the three Layouts.
 
  • Like
Reactions: eps
Upvote 0
Top