2011-06-02 40 views
3
<?xml version="1.0" encoding="UTF-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> 
    <gradient android:startColor="#4CC417" android:endColor="#7C4124" android:angle="270"/> 
    <corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp" android:topLeftRadius="7dp" android:topRightRadius="7dp"/> 
</shape> 

这是我的自定义按钮xml。我想修改代码以获得两种或更多种颜色。如何制作不同颜色的自定义按钮?

+0

我的问题是...你如何引用这个button.xml? – jffgrdnr 2011-07-29 00:39:51

回答

2

startColorendColor的渐变已经给出了2种颜色。中心颜色可以使用android:centerColor="#hexcode"添加。

相关问题