像这样在 XML 中设置很容易:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient android:startColor="#BFEEFF"
android:endColor="#40B9FF"
android:angle="270"/>
<corners
android:bottomLeftRadius="6dip"
android:bottomRightRadius="6dip"/>
</shape>
但是我怎样才能在java代码中设置它呢?