Change the color of a disabled button in android

后端 未结 6 1360
灰色年华
灰色年华 2021-02-03 22:56

Is there a way to change the color of a disabled button in android through styles or some other form ?

I currently have the following,

drawable/button_de

6条回答
  •  悲哀的现实
    2021-02-03 23:30

    Another way to achieve this is to create a color selector.

    Create a file

    res/color/your_color.xml
    

    which looks like

    
        
        
    
    

    Then you may use it as a regular color

    in a style:

    
    

    As well is in layouts, shapes or in code as etc.

提交回复
热议问题