How to add a gradient to buttons in android through xml?

前端 未结 4 1128
陌清茗
陌清茗 2020-12-29 06:25

I cannot figure out why this code will not work. Can anyone help? I am trying to get the button to use a custom color titled \'greenstart\' and \'greenend\'. The colors have

4条回答
  •  误落风尘
    2020-12-29 06:59

    Create a new xml file and put it in drawable and then add it to button as background

    gradient.xml

    
    
        
       
    
    

    layout.xml

     

提交回复
热议问题