Custom horizontal progress bar style black dashed _android in Android

Source: Internet
Author: User
Tags dashed line

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.