更改水平progressbar颜色

在drawable文件夹新建progressbar_bg.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:id="@android:id/background">
        <shape>
            <corners android:radius="5dp" />
            <gradient
                android:angle="0"
                android:centerColor="#fff0f1f0"
                android:centerY="0.75"
                android:endColor="#ffdee0de"
                android:startColor="#ffffffff" />
        </shape>
    </item>
    <item android:id="@android:id/secondaryProgress">
        <clip>
            <shape>
                <corners android:radius="5dp" />

                <gradient
                    android:angle="0"
                    android:centerColor="#F39801"
                    android:centerY="0.75"
                    android:endColor="#a0ffcb00"
                    android:startColor="#80ffd300" />
            </shape>
        </clip>
    </item>
    <item android:id="@android:id/progress">
        <clip>
            <shape>
                <corners android:radius="5dip" />

                <gradient
                    android:angle="0"
                    android:endColor="@color/color_01_point_out"
                    android:startColor="@color/color_01_point_out" />
            </shape>
        </clip>
    </item>
</layer-list>

在使用的progressbar的布局中添加一行

android:progressDrawable="@drawable/progressbar_bg"

设置progressbar水平

style="@style/Widget.AppCompat.ProgressBar.Horizontal"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值