怎样能定制出这种样式的进度条,主要是颜色,边框银色,没有填满的部分是透明的,求指教
学习是最好的投资!
<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
<?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>
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