透明黑色渐变形状可绘制颜色代码

Dev*_*v-X 13 android gradient shape android-drawable

视图寻呼机指示器的渐变

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient 
        android:startColor="#000"
        android:centerColor="#00000000"
        android:endColor="#000"
        android:angle="270"
        android:dither="true"
     />
</shape>
Run Code Online (Sandbox Code Playgroud)

这是我尝试的代码,但它最终成为纯黑色.

Fan*_*mas 43

这个渐变怎么样?底部完全透明,底部为50%透明黑色

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient 
        android:startColor="#00000000"
        android:endColor="#80000000"
        android:angle="270"
        android:dither="true"
     />
</shape>
Run Code Online (Sandbox Code Playgroud)