Android progressbar定制
PHPz
PHPz 2017-04-17 15:38:33
0
5
674

怎样能定制出这种样式的进度条,主要是颜色,边框银色,没有填满的部分是透明的,求指教

PHPz
PHPz

学习是最好的投资!

reply all(5)
小葫芦
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

    <item android:id="@android:id/secondaryProgress">
        这里定义你要的透明
        <clip >
            <shape >
                <corners android:radius="6dip" />
                <solid android:color="#EAEAEA"/>
            </shape>
        </clip>
    </item>

    <item android:id="@android:id/progress">
        <clip >
            <shape >
                <corners android:radius="6dip" />
                <solid android:color="#03A9F4"/>
            </shape>

        </clip>
    </item>
</layer-list> 
巴扎黑

Customize View, draw semicircles on both sides and a straight line in the middle. The progress changes are filled with white.

大家讲道理

There are many progress bar controls on github. Open the code to see how to implement it and follow the example

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

    <!--背景-->
    <item android:state_pressed="true">
        <shape>
            <!--色值-->
            <solid android:color="这样颜色值" />
            <!--圆角-->
            <corners android:radius="10dp" />
        </shape>
    </item>
</selector>
大家讲道理
<?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>
            <solid android:color="@color/home_feed_storke_color" />
        </shape>
    </item>
    <!-- 第二条进度条颜色 -->
    <item android:id="@android:id/secondaryProgress">
        <clip>
            <shape>
                <solid android:color="@color/home_feed_storke_color" />
            </shape>
        </clip>
    </item>
    <!-- 进度条 -->
    <item android:id="@android:id/progress">
        <clip>
            <shape>
                <solid android:color="@color/main_yellow" />
            </shape>
        </clip>
    </item>

</layer-list>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template