How to make a gradient background for a LinearLayout?

前端 未结 2 1042
我寻月下人不归
我寻月下人不归 2021-02-09 16:19

I was wondering, what would be the best way to make a gradient background for a LinearLayout in java ( not xml ) ?

Any ideas?

Thanks!

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-09 16:41

    Besides xml you can also use GradientDrawable it has corresponding methods for all xml attributes

提交回复
热议问题