【发布时间】:2012-11-27 19:45:28
【问题描述】:
W 想要一个drawable,它的左侧有背景和渐变,大约是10dp 宽。
我想要实现的图像:
- 左边的红色渐变
- 其余的背景
我怎样才能做到这一点?
我用两种形状尝试过layer-list,但没有成功。
物品背景:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/background" />
<item android:drawable="@drawable/gradient" />
</layer-list>
背景可绘制:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/black" />
</shape>
形状可绘制:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#FFFF0000" android:endColor="#80FF00FF"
android:angle="90"/>
<size android:width="10dp" />
</shape>
【问题讨论】:
-
您能否更准确地解释您需要什么,如果您有更好的期望图像上传,将提供更好的想象力。
-
我已经上传了图片,它会更清楚地解释它(我希望;))
标签: android drawable gradient shape