1
我有Android的绘制,我要去申请的背景几个TextViews改变形状颜色在Android XML
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#000000" />
</shape>
</item>
<item android:id="@+id/clr"
android:left="0.5dp" android:right="0.5dp" android:top="0.5dp" android:bottom="0.5dp" >
<shape android:shape="rectangle">
<solid android:color="#FFF000" />
</shape>
</item>
</layer-list>
我要编程上改变这种颜色。我怎样才能做到这一点?
尝试:http://stackoverflow.com/questions/5940825/android-change-shape-color-in-runtime?rq=1 –
此用户也声称此解决方案的工作原理:http://stackoverflow.com/a/10448441/2157961 – cheezy
谢谢。只需稍作修改就可以解决问题 – Ajitha