Listview with more than 2 lines

walterf25

Expert
Licensed User
Longtime User
Hello everyone, i was wondering if someone can shed some light for me, i'm working on updating one of my apps, basically what i need is a listview where i can display something like this:

first line:
Bus Line #128, East to Palmdale
Second line:
5 Minutes
30 Minutes
60 Minutes
75 Minutes

I tried doing this with
B4X:
listview1.addtwolines(String1, String2)

but it doesn't seem to work as i expected, I also would like to assign a different color to each label on the listview!

I've read almost all the threads that mention custom listviews but none of them work for my purppose, i hope someone has an idea how to accomplish this task!

Thanks,
Walter
 

walterf25

Expert
Licensed User
Longtime User
Listview with more then 2 lines

Hi All, thanks for all your replies and suggestions, I'm trying to stay away from creating my own custom listview for this, i was hoping i'd find something already put together for this purpose, but it looks that i might have to go that route, attached is a screenshot of how it looks now, but i would like to be to insert all the arrival times for any specific route under the same line or label, as you guys can see in the picture the way i have them now each arrival time is each in it's own line.
I have already tried the CRLF but it doesn't seem to work for me!

schedules.jpg


thanks All!
 
Upvote 0

eps

Expert
Licensed User
Longtime User
You can have two different colours , easily, but not more than this. This is because ListView applies the same colour to all Elements. You can have two as per my link above, but it depends on what you're trying to achieve..
 
Upvote 0

DouglasNYoung

Active Member
Licensed User
Longtime User
Expanding on the last post, you could have:-
a) A two line element for the header (bus route & number) with single line element(s) for the next busses.
B) A single line element for the Route/Number, much as now, and double line elements for the next services.

Note that you can, if you wish, use only one of the lines in a two line element, and using a two lines and image can add a bit more interest.
Perhaps the bus number could be an image with a route description following & single line items for the times?

Unfortunately, I can't seem to upload an example from my phone, but could email or post an image from a computer later, if you're interested.

Douglas
 
Upvote 0
Top