Android Question CustomsListView - Change Color for selected item

brodmuehler

Member
Licensed User
Longtime User
Hi

is it possible to click on an item on a CustomsListView and change the background color for the clicked item permanently so that it appears selected.

Or put a frame around the item, so that the user can see that this item is selected for further steps, e.g. delete, edit, etc....

Thanks
René
 

mangojack

Expert
Licensed User
Longtime User
B4X:
Sub clv1_ItemClick(Index As Int, Value As Object)
    Dim p As Panel = clv1.GetPanel(Index)
    p.Color = Colors.Blue
End Sub

see this for setting panel color and border at runtime .. Add border to panel with code

You will need to create a variable to reset last clicked item on subsequent clicks.
 
Last edited:
Upvote 0

udg

Expert
Licensed User
Longtime User
You could even add a CheckBox item to your CLV's item.
CheckBox click event will set/unset each item on user action. Finally, you will iterate on them when an action is due (delete, synchronize with server..).
 
Upvote 0
Top