Android button with different background colors

前端 未结 4 847
借酒劲吻你
借酒劲吻你 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:30

    in Mono Android you can use filter like this:

    your_button.Background.SetColorFilter(new Android.Graphics.PorterDuffColorFilter(Android.Graphics.Color.Red, Android.Graphics.PorterDuff.Mode.Multiply));
    

提交回复
热议问题