I have a button that at the time of design applies the property BorderWidth = 1 and BorderColor = FFF9F9F9.
This is perfect until at run time I apply color to the bottom of the button!
B4X:
Dim AC As AppCompat
Button1.Color= AC.GetThemeAttribute("colorAccent")
Is it possible to prevent this from happening?
or Is it possible to set the edge property at run time?
It may be because you are replacing the previously set properties. Try this:
B4X:
Dim AC As AppCompat
Dim sldButton1 As StateListDrawable
Dim cdButton1 As ColorDrawable
sldButton1.Initialize
cdButton1.Initialize2(AC.GetThemeAttribute("colorAccent"), 0dip, 1dip, 0xFFF9F9F9) ' 0xFFF9F9F9: not sure if it's the correct syntax but you can change it with Color.RGB(...)
sldButton1.AddState(sldButton1.State_Enabled, cdButton1) ' State_Enabled
cdButton1.Background = sldButton1