iOS Question CustomListView background images

db0070

Active Member
Licensed User
Longtime User
I am having problems trying to set customListView to set background images. This is the code I have:-
B4X:
Dim imgBg As ImageView
Dim bg As Bitmap

bg.Initialize(File.DirAssets,"almbtnsel.png")
imgBg.Initialize("imgBg")
imgBg.Bitmap = bg

    List1.AddTextItem("Item1",0)
    List1.AddTextItem("Item2",1)    
    List1.AddTextItem("Item3",2)

    For i = 0 To List1.GetSize -1
        pnl = List1.GetPanel(i)
        pnl.Color = Colors.Transparent
        pnl.AddView(imgBg,0,0,pnl.Width,pnl.Height)
    Next

The first item's background is cleared when the 2nd item background is set, and then the 1st and 2nd item backgrounds are cleared when the 3rd item background is set. I am trying to get all three panel to have the same background image, (the selected item will have a different image.)

The second problem is that if I have a second List2 on top of of List1, I cannot get to fire the events of List1, even if I use List1.sv.BringToFront - it fires the 2nd list's event.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…