Android Question Different background colors for odd/even rows in ListView

vecino

Well-Known Member
Licensed User
Longtime User
Hello, is it possible?
I have seen this same question for B4J, but I don't know if it is possible to implement it for B4A.
Thank you.
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Never. No good reason.

xCLV is cross platform, more powerful and easier to work with.
If you add simple text items:
B4X:
Dim clrs() As Int = Array As Int(xui.Color_LightGray, xui.Color_White)
For i = 0 To 99
    CustomListView1.AddTextItem("Item #" & (i + 1), "")
    CustomListView1.GetPanel(i).Color = clrs(i Mod 2)
Next
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
A doubt.
I already use CustomListView in some cases, does this xCustomListView replace the CustomListView?
Can I use both at the same time?
So I don't have to rewrite the code I use with CustomListView, or are they compatible?
Thank you.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
You cannot use them together. xCustomListView replaced CustomListView. It shouldn't be too difficult to switch from the old CLV to the newer xCLV. You will need to remove the CLV from the layout and add it again.
Note that xCLV is also named CustomListView in the IDE.
Yes, that's why I had the doubt, because they have the same name.
Thank you.
 
Upvote 0
Top