我不是ui设计师,所以感觉xml颜色不够,我想做这样的渐变:
http://t1.uccdn.com/en/images/6/5/2/img_2256_ins_45517_600.jpg

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
    <shape>
        <gradient
            android:startColor="#1f313d"

            android:endColor="#2c3942"
            android:angle="135"/>
    </shape>
</item>

但是…我认为两种颜色是不够的,那么如何使它与这幅图像的梯度相似呢?*最后一个屏幕

最佳答案

如何创建渐变??
创建渐变非常容易
右键单击drawable文件夹并创建xml文件。
创建形状标记
内部形状标记创建渐变标记
梯度特性……..

android:startColor="put here your color"
android:endColor="put here your color"
android:centerColor="put your color here"
android:angle="45"

如果你需要渐变
水平方向放置角度=“0”
垂直放置角度=“90”
拐角水平方向放置角度=“45”
与拐角水平方向相反,将角度设为“135”
使用这个…….
<shape xmlns:android="http://schemas.android.com/apk/res/android">

    <gradient android:startColor="#915d5b"
        android:endColor="#418c47"
        android:angle="45"></gradient>
</shape>

android - 像这样的渐变?-LMLPHP
享受编码……

10-05 21:14
查看更多