【发布时间】:2012-08-23 09:24:19
【问题描述】:
我不知道为什么这段代码不起作用。任何人都可以帮忙吗?我试图让按钮使用名为“greenstart”和“greenend”的自定义颜色。颜色已在 res/value/string.xml 文件中创建。我看过类似的问题,但要么没有答案,要么不清楚,要么解决方案不起作用。提前致谢。
XML 文件样本:
<Button
android:id="@+id/mycollection"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="1" >
<Gradient
android:angle="270"
android:endColor="@color/greenstart"
android:startColor="@color/greenend" >
</Gradient>
</Button>
【问题讨论】:
标签: android xml user-interface button colors