Android Question Change onclick color of listview

Alessandra Pellegri

Active Member
Licensed User
Longtime User
I would like to change the color of listview items when they are clicked.
Default color appears to be orange but I should set to blue.


How could I do that ?

Than you
 

Alessandra Pellegri

Active Member
Licensed User
Longtime User
Ok,
But is not possible change that color in standard listview? My project is near to be finished and I would prefer very much to not make deep changes.

Where actual 'orange' is defined?
 
Upvote 0

Alessandra Pellegri

Active Member
Licensed User
Longtime User
But changing some xml or something in manifest could I change it ?

For example in the manifest there was a row:
B4X:
 SetApplicationAttribute(android:theme, "@android:style/Theme.Holo")

I changed it to:

B4X:
 SetApplicationAttribute(android:theme, "@android:style/Theme")
because now the app appears better.

Could I take this theme and change it ? Where I can find the file ?

Thank you
 
Upvote 0

Alessandra Pellegri

Active Member
Licensed User
Longtime User
I found a kind of solution:
B4X:
   Dim slv1 As StateListDrawable
   Dim cdwColor As  ColorDrawable
   cdwColor.Initialize(Colors.ARGB(255,191,219,255),0)
   slv1.Initialize
   slv1.AddState(slv1.State_Pressed,  cdwColor)
   ListView1.SingleLineLayout.Background=slv1

but if I put Alpha channel a little transparent I can see original orange color behind my blue-sky.
I suspect that it is because xml files. Nobody knows how to midify them ?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…