Android ProgressBar Custom mode, custom mode animation file

Source: Internet
Author: User

1.indeterminate Mode | Progress bar with no specific progress

1.1 Customizing animation files
[HTML]View Plaincopy
  1. < ProgressBar
  2. android:layout_width "wrap_content"
  3. android:layout_height "wrap_content"
  4. android:indeterminatedrawable "@drawable/progress_my_style"
  5. style = "? Android:attr/progressbarstyle"



Note: style= "? Android:attr/progressbarstyle" This is the default style, can be changed

Step2: Create the Progress_my_style.xml file under the Drawable folder: The contents can be as follows:

[HTML] view Plaincopy

  1. < animated-rotate xmlns:android = "http://schemas.android.com/apk/res/android"
  2. android:drawable = "@drawable/spinner_color"
  3. android:pivotx = "50%"
  4. android:pivoty = "50%"
  5. />




Attention:
1. android:drawable= "@drawable/spinner_color" here, you need to create a spinner_color.png image under drawable (you can draw the effect (gradient) you think of)

2. progress_my_style.xml file contents refer to D:\andrirod\android-sdk-windows\platforms\android-7\data\res\drawable\ Progress_medium_white.xml file contents, android:framescount and android:frameduratiion are intrinsic properties of the frameworks and cannot be used directly, so omitted)
The above is defined directly in XML, which I define directly in the code:
http://www.52liezheng.com/info/337083.html
http://www.52liezheng.com/info/337085.html
http://www.52liezheng.com/info/337087.html
http://www.52liezheng.com/info/337091.html
http://www.52liezheng.com/info/337089.html
http://www.52liezheng.com/info/340881.html
http://www.52liezheng.com/info/340882.html
http://www.52liezheng.com/info/340883.html
http://www.52liezheng.com/info/340885.html
http://www.52liezheng.com/info/340886.html
http://www.52liezheng.com/info/340887.html
http://www.52liezheng.com/info/340888.html

Android ProgressBar Custom mode, custom mode animation file

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.