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

前端 未结 4 1135
陌清茗
陌清茗 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 07:06

    So here we go with the gradient. As above @Dusean Singh said. If you will use an angle 270 then your gradient will start from top to down : TOP -> Center -> bottom

    
        
    
    

    If you will use an angle 360 then your gradient will start from left to right : Left -> Center -> Right

    
        
        
    
    

    Here we go with the effect. and how to apply the same on button

    
        

提交回复
热议问题