问题
I'm trying to make a button's color to be a gradient from white to transperent to black. My problem is that the button is on top of an image which makes it impossible to use background.
I'm currently using the following code which doesn't build:
<?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="color/transparent"
android:startColor="#E8E8E8"
android:endColor="#171717"
android:type="linear"
/>
<padding
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
/>
<stroke
android:width="3dp"
android:color="#878787"
/>
Error
"error: 'color/transparent' is incompatible with attribute android:centerColor (attr) color. Message{kind=ERROR, text=error: 'color/transparent' is incompatible with attribute android:centerColor (attr) color. "
thanks for the helpers!