下の画像のように見えるドローアブルを作成しようとしています。1dp
それぞれが異なる色の3本の水平線で、残りのスペースはグラデーションで埋める必要があります。
だから私はこれを書いた:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="line">
<stroke android:width="1dp" android:color="#c80047"/>
</shape>
</item>
<item android:top="1dp">
<shape android:shape="line" >
<stroke android:width="1dp" android:color="#5ec800"/>
</shape>
</item>
<item android:top="2dp">
<shape android:shape="line" >
<stroke android:width="1dp" android:color="#ffffff"/>
</shape>
</item>
<item android:left="0dp" android:right="0dp" android:top="3dp">
<shape android:shape="rectangle">
<gradient android:angle="-90" android:startColor="#3B3B3B"
android:endColor="#000000" />
</shape>
</item>
</layer-list>
グラデーションは正しく描画されますが、3本の線は黒のままです。結果なしで追加しようとしました<stroke android:color="a_color" />
。
私は何が欠けていますか?