listview background color

Cor

Active Member
Licensed User
Longtime User
How to set background color of

ListView1.SingleLineLayout.Label.background=????

grCor
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Here:
B4X:
Sub Activity_Create(FirstTime As Boolean)
    Dim lv1 As ListView
    lv1.Initialize("lv1")
    Dim gd As GradientDrawable
    gd.Initialize("BOTTOM_TOP", Array As Int (Colors.White, Colors.Black, Colors.White))
    lv1.SingleLineLayout.Background = gd
    For i = 1 To 100
        lv1.AddSingleLine("Item #" & i)
    Next
    Activity.AddView(lv1, 0, 0, 100%x, 100%y)
End Sub
listview_16_11.png
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
How to change the background of a specific item?

You cannot...

You just can
- Set the background for ALL "Single line Items"
- Set the background for ALL "Two line Items"
- Set the background for ALL "Two line items with graphics"

So you can set a background for each of these three "Groups"...
 
Upvote 0
Top