B4A Question Difference DefaultDrawable and StateListDrawable buttons regarding button edge - Erel (first post)    Jun 01, 2022   (1 reaction) As you saw, the buttons' default drawable includes an internal padding that you cannot remove. Share My Creation Phone Info - NJDude (first post)    Apr 22, 2015   (4 reactions) That's a StateListDrawable button. B4A Question Button pressed property - LucaMs (first post)    Feb 22, 2022   (1 reaction) I agree about RadioButtons.
Note that if you set the color of a Button, it loses its original shape. If the project is B4A only, you could use StateListDrawable.
Without using Tags, it is useful to use a variable of type Button (if you do not use B4XView) declared at module level, which you will u B4A Question [SOLVED] StateListDrawable on 2 buttons - DonManfred (first post)    May 15, 2021   (1 reaction) Do not reuse a drawable.
Create a new crawable for each button. B4A Question Adding StatelistDrawable button in code - RB Smissaert (first post)    Oct 11, 2022 No, it is working fine and just found the same.
RBS B4A Question XUI Dialog and StateListDrawable buttons - wimpie3    Apr 24, 2022 A possible bug (or perhaps it's me overlooking something...)
I'm creating a state list:
Dim DefaultDrawable, PressedDrawable As ColorDrawable
DefaultDrawable.Initialize(Colors.Green,55dip)
PressedDrawable.Initialize(Colors.Red,55dip)
Dim sld As StateListDrawable
sld.Initialize
B4A Question [Solved] Button corner radius reset to 0 when change color - aeric (first post)    Feb 18, 2019   (1 reaction) I have used the StateListDrawable in designer but when I change the colour with code, the corner reset to 0.
The StateListDrawable only have Enabled, Disabled and Pressed Drawable. I want the button change colour.
77488 B4A Question StateListDrawable and Button - Anser (first post)    Sep 16, 2015   (1 reaction) Got it working.
The following line was missing. Added it and got it working
sld.AddCatchAllState(EnabledClr)
But this line is missing in the Tutorial posted here too.
https://www.b4x.-example.6589/
Regards
Anser B4A Question Debug mode displays correct result but release mode doesn't - LucaMs (first post)    May 11, 2018 tri-state button (StateListDrawable) B4A Question How to modify Drawable properies of a command button? - klaus (first post)    Oct 15, 2021   (2 reactions) You cannot apply it directly to a B4XView.
You need to do it on the B4A button.
StateListDrawable is Android, therefor B4A specific.
You could do it like this:
#If B4A
Private cdwGreenColorEnabled As ColorDrawable
cdwGreenColorEnabled.Initialize(Colors.Green,10)
' Define a color for Pe Page: 1   2   3   4   5   6   7   Powered by ColBERT |