将图像添加到XML渐变按钮

时间:2013-07-22 07:22:17

标签: android xml button gradient

我使用bstyle.xml

创建了一个渐变按钮
<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<corners
android:radius="14dp"

/>
<gradient
android:angle="45"
android:centerX="35%"
android:centerColor="#A8A8A8"
android:startColor="#E8E8E8"
android:endColor="#EBFEFF"
android:type="linear"
/>
<padding
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
/>
<size
android:width="60dp"
android:height="55dp"
/>
<stroke
android:width="3dp"
android:color="#919089"
/>
</shape>

在布局中我已经设置了按钮的背景,它可以工作,但我想要的是我想在渐变按钮上放置一个图像(如图像按钮),我该怎么办?

0 个答案:

没有答案