Android Question Why does ToggleButton not have Drawable properties in Designer?

Widget

Well-Known Member
Licensed User
Longtime User
The ToggleButton has Background property like a regular Button, but unlike Button, the ToggleButton does NOT have Button Properties.Drawable properties (DefaultDrawable/StatelistDrawable) in the Designer. Why not? The only way to assign a background color to a ToggleButton is to use code. Is this by design or was it accidentally left out of the Designer?

TIA
 

Widget

Well-Known Member
Licensed User
Longtime User
I think that it is less likely for developers to change the ToggleButton drawables so it was not implemented in the designer.

Code example: StateListDrawable example

Maybe I'm old fashioned, but I thought views with State, like ToggleButton, RadioButton and CheckBox would have a StatelistDrawable option in the Designer so the color or icon would change when the button's state changes from Checked to Unchecked, Pressed... etc.. The conventional Button has StateListDrawable but not the more sophisticated views that I just mentioned. It just seems weird to me, that's all.

I'll take a look at the code example. Thanks.
 
Upvote 0
Top