Custom ProgressBar (Picture implementation)

Source: Internet
Author: User

Custom ProgressBar:

1. Choose a picture

2. Create a rotate-related XML file under drawable

3. Customize a style to introduce a custom style on the control ProgressBar, specifying the rotational speed

Rotate_progressbar.xml under the drawable file

<rotate xmlns:android= "Http://schemas.android.com/apk/res/android"
android:drawable= "@drawable/progressbar3"//pictures of Pickup
android:fromdegrees= "0"
Android:todegrees= "360"
android:pivotx= "50%"
android:pivoty= "50%" >
</rotate>

Custom style:

<style name= "Style_progressbar" >
<item name= "android:indeterminatedrawable" > @drawable/rotate_progressbar</item>
<item name= "Android:minwidth" >76dip</item>
<item name= "Android:maxwidth" >76dip</item>
<item name= "Android:minheight" >76dip</item>
<item name= "Android:maxheight" >76dip</item>
</style>

<progressbar
Android:id= "@+id/progressbar1"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
style= "@style/style_progressbar"
Android:indeterminateduration= "/>"//specified speed

Custom ProgressBar are implemented in three ways: animations, custom colors, pictures.

Custom ProgressBar (Picture implementation)

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.