网友通过本文主要向大家介绍了自定义水平进度条,android 自定义进度条,自定义进度条,安卓自定义进度条,自定义圆形进度条等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
自定义水平进度条样式:黑色虚线,进度条虚线
布局layout中使用:

1 <ProgressBar 2 android:id="@+id/progress_bar" 3 >![]()
下面为xml源代码myprogress.xml:
1 <?xml version="1.0" encoding="utf-8"?> 2 <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > 3 <!--item background与progress 顺序不可颠倒 --> 4 <item android:id="@android:id/background" > 5 <shape android:shape="line"> 6 <stroke 7 android:width="4dp" android:color="#666666" <!--背景颜色和宽度--> 8 android:dashWidth="4dp" android:dashGap="1dp" /> <!--虚线间隔1dp--> 9 </shape> 10 </item> 11 <item android:id="@android:id/progress" > 12 <clip> 13 <shape android:shape="line"> 14 <stroke 15 android:width="4dp" android:color="#000000" 16 android:dashWidth="4dp" android:dashGap="1dp" /> 17 </shape> 18 </clip> 19 </item> 20 </layer-list>![]()