Android button with different background colors

前端 未结 4 843
借酒劲吻你
借酒劲吻你 2020-12-07 15:34

i want to change the background-color of a button using a selector-xml-file. My approach is basically the one from the example at the bottom this page: http://developer.andr

4条回答
  •  遥遥无期
    2020-12-07 16:23

    You have to put the selector.xml file in the drwable folder. Then write: android:background="@drawable/selector". This takes care of the pressed and focussed states.

提交回复
热议问题