答案 0 :(得分:0)
尝试这样的事情:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="@color/background_light_grey"
android:endColor="@color/transparent"
android:angle="90"/>
</shape>
答案 1 :(得分:0)
尝试在res / try中创建一个可绘制资源,并在android:endColor="#80000000"
中使用透明颜色
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient android:type="radial" android:gradientRadius="250"
android:startColor="#ff2d9a59"
android:centerColor="#ff42959a"
android:endColor="@android:color/transparent"// add here transparent color
/>
</shape>
</item>
</selector>