har*_*i86 6 xml android gradient android-drawable
嗨,我试图使用shape.xml在顶部获得渐变阴影
从图像中包裹线性布局中的按钮,我想在布局的顶部给出渐变.
我正在做如下,但它没有成功
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape
android:shape="rectangle">
<stroke android:width="1dp" android:color="#f0f0f0" />
<solid android:color="#f0f0f0" />
</shape>
</item>
<item android:top="1dp">
<shape
android:shape="line">
<gradient
android:angle="90"
android:type="linear"
android:startColor="#FFFFFF"
android:endColor="#000000" />
</shape>
</item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)
Zah*_*lam 11
不需要使用Layer-list,你可以通过Gradient.试试这个流动的代码 - >
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient android:startColor="#b4909090" android:endColor="#b4fafafa" android:angle="90"/>
</shape>
Run Code Online (Sandbox Code Playgroud)
更改startColor和endColor你想要的.结果是 - >
| 归档时间: |
|
| 查看次数: |
15370 次 |
| 最近记录: |