Hi guys, just want to ask how can i change the background color of my CustomListView when i click or press one of the list. Currently, its constantly giving me the orange color.
Thank you that will work, however, when you click on the panel, they will turn to green but if ever you select and click another panel, it will also turn to green. Also the click event of customlist view will be disabled. Im thinking that it would be better if we change the code in customlistview to change the actual click event for it.
For anyone having the same issue kindly use NinePatch Drawabales tutorial. What i did is make a sub which returns a drawable like this
B4X:
Public Sub SetNinePatchDrawable( ImageName As String) As BitmapDrawable
Dim r As Reflector
Dim package As String
Dim id As Int
package = r.GetStaticField("anywheresoftware.b4a.BA", "packageName")
id = r.GetStaticField(package & ".R$drawable", ImageName)
r.Target = r.GetContext
r.Target = r.RunMethod("getResources")
Return r.RunMethod2("getDrawable", id, "java.lang.int")
End Sub
Then i made use of a png background placed inside Objects > res > drawable. Set it to read only and just call it's file like this