The following content introduces the black dotted line of custom horizontal progress bar style in Android. Friends who are interested in the code implementation method will learn together.
Used in layout layout:
<ProgressBar android: 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="" android:indeterminateOnly="false" />
The following is the xml source code:
<?xml version="." encoding="utf-"?> <layer-list xmlns:andro > <!--item backgroundandprogress The order cannot be reversed --> <item android: > <shape android:shape="line"> <stroke android:width="dp" android:color="#" <!--Background color and width-->android:dashWidth="dp" android:dashGap="dp" /> <!--Dotted line intervaldp--> </shape> </item> <item android: > <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 relevant knowledge about the custom horizontal progress bar style of black dotted lines in Android that this article shares with you. I hope it will be helpful to everyone!