T Tasyo28 Member Licensed User Aug 28, 2019 #1 Hi, Can somebody help me to achieve this: Initially, the button will be like this: When clicked it should be like this: - to change the color of the button when clicked (change color and add border) (note: button created in designer) - to check button state if the color is gold or grey if button1.color = "gold or grey" then .... else .... endif I hope somebody can advise how can I do it in B4a thanks.
Hi, Can somebody help me to achieve this: Initially, the button will be like this: When clicked it should be like this: - to change the color of the button when clicked (change color and add border) (note: button created in designer) - to check button state if the color is gold or grey if button1.color = "gold or grey" then .... else .... endif I hope somebody can advise how can I do it in B4a thanks.
Erel B4X founder Staff member Licensed User Longtime User Aug 28, 2019 #2 You need to use StateListDrawable. See this example: https://www.b4x.com/android/forum/threads/statelistdrawable-example.6589/ Or change the colors with the designer. Upvote 0
You need to use StateListDrawable. See this example: https://www.b4x.com/android/forum/threads/statelistdrawable-example.6589/ Or change the colors with the designer.
T Tasyo28 Member Licensed User Aug 29, 2019 #3 Erel said: You need to use StateListDrawable. See this example: https://www.b4x.com/android/forum/threads/statelistdrawable-example.6589/ Or change the colors with the designer. Click to expand... Hi Erel, thank you very much it works! more power to B4X Upvote 0
Erel said: You need to use StateListDrawable. See this example: https://www.b4x.com/android/forum/threads/statelistdrawable-example.6589/ Or change the colors with the designer. Click to expand... Hi Erel, thank you very much it works! more power to B4X