[英]How to set gradiant color for stroke in shape in Android
I want create custom background and i want create this in drawable
folder. 我想创建自定义背景,我想在
drawable
文件夹中创建它。
For this background i write below codes : 对于这个背景,我写下面的代码:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:width="1dp"
android:color="@color/gradient_center" />
<corners android:radius="5dp" />
</shape>
but in this code i just set sold color for stroke
, i want set gradient color for stroke
color. 但在这段代码中,我只设置了
stroke
售色,我想为stroke
颜色设置渐变色。
how can i it? 我怎么样?
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="90"
android:endColor="#b5b6d2"
android:startColor="#555994"
android:type="linear" />
<corners android:radius="5dp" />
</shape>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.