Hi,
I've added a button into a panel, and added some states to it. the state_enabled is working, but when I press the button, the pressed state is not showing. The button is pressed because the click event is fired.
the code goes like this:
the button is added into a panel that is added later into lstpreferencias, a customlistview. I also add edittexts and spinners that works fine with their backgrounds (not statelists).
the button shows blue (statelist enabled) but never turns magenta.
I appreciate your help!
Regards!
I've added a button into a panel, and added some states to it. the state_enabled is working, but when I press the button, the pressed state is not showing. The button is pressed because the click event is fired.
the code goes like this:
B4X:
Dim btnFechaNacimiento As Button
btnFechaNacimiento.Initialize("btnFechaNacimiento")
btnFechaNacimiento.TextColor = Colors.Gray
btnFechaNacimiento.Gravity = Bit.Or(Gravity.CENTER_VERTICAL, Gravity.CENTER_HORIZONTAL)
btnFechaNacimiento.Typeface = Typeface.DEFAULT
Dim d As ColorDrawable
Dim d1 As ColorDrawable
Dim d3 As ColorDrawable
Dim sd As StateListDrawable
d.Initialize(Colors.magenta, 4)
d1.Initialize(Colors.blue, 4)
d3.Initialize(Colors.red, 4)
sd.Initialize
sd.AddState(sd.State_Enabled, d1)
sd.AddState(sd.State_Pressed, d)
sd.AddCatchAllState(d3)
btnFechaNacimiento.Enabled=True
btnFechaNacimiento.Background = sd
P.AddView(btnFechaNacimiento, x, y, w, h)
lstPreferencias.Add(P, height,Null)
the button is added into a panel that is added later into lstpreferencias, a customlistview. I also add edittexts and spinners that works fine with their backgrounds (not statelists).
the button shows blue (statelist enabled) but never turns magenta.
I appreciate your help!
Regards!