Android Question Change color of selector icon on spinner

mare1980k1

Member
Licensed User
Longtime User
I found some things but can't seem to wrap my head around this. I think it could be used as a sub like the example for changing color of the checkbox:
B4X:
Sub SetColorTintList(CB As CheckBox,Checked As Int,Enabled As Int,Disabled As Int)

   Dim States(3,1) As Int

   States(0,0) = 16842912   'Checked
   States(1,0) = 16842910    'Enabled
   States(2,0) = -16842910 'Disabled


   Dim Color(3) As Int = Array As Int(Checked,Enabled,Disabled)

   Dim CSL As JavaObject
   CSL.InitializeNewInstance("android.content.res.ColorStateList",Array As Object(States,Color))
   Dim CB1 As JavaObject = CB
   CB1.RunMethod("setButtonTintList",Array As Object(CSL))
End Sub

The property I found on android website is called
"android:dropDownSelector"
List selector to use for spinnerMode="dropdown" display.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

I just don't know how to implement this in B4A, or is it the right property to start with?
Please help,
Thank you in advance.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…