I have a shape that I'm using in a layout. I want the color to be programmatically changed in my activity.
<shape android:id="@+id/shape1" xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient android:id="@+id/gradient1"
android:startColor="@color/widget_header"
android:endColor="#0000CC"
android:angle="270"/>
<corners android:bottomRightRadius="1dp"
android:bottomLeftRadius="1dp"
android:topLeftRadius="7dp"
android:topRightRadius="7dp"/>
</shape>
Is there any way I could change the "startColor" and "endColor" attributes in my Activity?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…