How do you programmatically add/remove style to an android button? Is it possible to apply the styling at runtime?
I have two buttons that look like these
---------- ----------
| Button A | | Button B |
---------- ----------
what i wanted to do is when a button is clicked (lets say Button B), it runs some code, then changes the style of button B to something else (i.e highlighted borders) and will be something like this:
---------- ==========
| Button A | || Button B ||
---------- ==========
I know how to do the styling(i.e create the style) in XML, all I want to know is how to apply the styles on runtime/using java code.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…