本文介绍了Android的梯度4 PARAMS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我怎样才能让一个梯度像这样的xml
我不能只用这些PARAMS做
startColor =
centerColor =
ENDCOLOR =
什么想法?
解决方案
<?XML版本=1.0编码=UTF-8&GT?;
<形状的xmlns:机器人=http://schemas.android.com/apk/res/android机器人:形状=矩形> <梯度
机器人:角=90
机器人:centerColor =#555994
机器人:ENDCOLOR =#b5b6d2
机器人:startColor =#555994
机器人:类型=线性/> <角落
机器人:半径=0dp/>< /形状>
How can I make a gradient like this in xml
I can not do it with just these params
startColor=""
centerColor=""
endColor=""
any ideas ?
解决方案
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<gradient
android:angle="90"
android:centerColor="#555994"
android:endColor="#b5b6d2"
android:startColor="#555994"
android:type="linear" />
<corners
android:radius="0dp"/>
</shape>
这篇关于Android的梯度4 PARAMS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!