How to disable the default Button color changing property on onClick

前端 未结 1 1746
迷失自我
迷失自我 2021-01-16 15:40

For the default android button, when I click on it, its color is changed to orange for a few seconds (for notifying the user the button is clicked). Anyway, I don\'t want th

1条回答
  •  隐瞒了意图╮
    2021-01-16 16:33

    Have a look on how button is styled by Android:

     
         
         
         
         
         
         
         
    
    

    To style your button with Android's themes images resources, just create your own selector by copying the Android's one and replace all @drawable/btn_default_* by @android:drawable/btn_default_normal in items tag (and just remove items you don't want). For example :

     
         
    
    

    Then, apply this drawable selector as a android:background of your button.

    Hope it helps.

    (If you want, I can also provide an example of applying this background easily to all your buttons, just ask.)

    0 讨论(0)
提交回复
热议问题