首页 > 移动平台 > 详细

android ProgressBar定制模式,自定义模式动画文件

时间:2015-04-17 00:56:27      阅读:303      评论:0      收藏:0      [点我收藏+]

1.indeterminate mode | 没有具体进度的进度条

1.1 定制动画文件
[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"

 

 



注:style="?android:attr/progressBarStyle" 这是默认样式 ,可换改

step2: 在drawable文件夹下建立progress_my_style.xml文件:内容可如下:

[html] view plaincopy

  1. <animated-rotatexmlns:android="http://schemas.android.com/apk/res/android"
  2. android:drawable="@drawable/spinner_color"
  3. android:pivotX="50%"
  4. android:pivotY="50%"
  5. />




注意:
1. android:drawable="@drawable/spinner_color" 这里,你需要在drawable下建立spinner_color.png图片(自己画成你所想到的效果(渐变))

2. progress_my_style.xml文件内容参考至D:\andrirod\android-sdk-windows\platforms\android-7\data\res\drawable\progress_medium_white.xml文件内容,
android:framesCountandroid:frameDuratiion是frameworks内部的属性,无法直接使用,所以省略)
以上是在XML中直接定义,下面是我在代码里直接定义的:
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定制模式,自定义模式动画文件

原文:http://www.cnblogs.com/gsdfg54564/p/4433680.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!