The following is a description of the black dashed line of the custom horizontal progress bar style in Android, a friend who is interested in the code implementation.
Use in Layout layout:
<progressbar
android:id= "@+id/progress_bar"
style= "Android:attr/progressbarstylehorizontal" <!-- Must be set to horizontal-->
android:progressdrawable= "@drawable/myprogress" <!--use custom styles here-->
Android:layout_ Width= "DP"
android:layout_height= "DP"
android:layout_margintop= "DP"
android:maxheight= "
dp" Android:minheight= "DP"
android:max= ""
android:secondaryprogress= ""
android:progress= ""
The following is the XML source code myprogress.xml:
<?xml version= "." Encoding= "utf-"?> <layer-list xmlns:android=
"http://schemas.android.com/apk/res/ Android ">
<!--Item background and progress order cannot be reversed-->
<item android:id=" @android: Id/background " >
<shape android:shape= "line" >
<stroke
android:width= "DP" android:color= "#" <!-- Background color and width-->
android:dashwidth= "DP" android:dashgap= "DP"/> <!--dotted interval dp-->
</shape>
</item>
<item android:id= "@android: id/progress" >
<clip>
<shape android:shape = "line" >
<stroke
android:width= "DP" android:color= "#"
android:dashwidth= "DP" Android: Dashgap= "DP"/>
</shape>
</clip>
</item>
</layer-list>
The above is the article to share the Android custom horizontal progress bar style of the black dotted line of knowledge, I hope to help you!