Defined custom shape for button in xml. Now I want to change the color dynamically. How?

前端 未结 3 899
情书的邮戳
情书的邮戳 2020-12-11 12:26

I have this:

round_button.xml




        
3条回答
  •  余生分开走
    2020-12-11 13:20

    You could construct the shapes from code, depending on the color you need to use, create a StateListDrawable from those and set it as your buttons background.

提交回复
热议问题