【发布时间】:2011-10-28 06:44:06
【问题描述】:
我在可绘制文件夹中有一个可绘制的形状。这是 XML 结构:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#4D0418"
android:centerColor="#5F031D"
android:endColor="#7D0227"
android:angle="-90" />
</shape>
现在我想在运行时的 java 代码中更改 startColor、centerColor、endColor。怎么可能改变?
【问题讨论】:
-
你应该可以使用 Java 反射来做到这一点。
标签: android colors gradient shape