Android圆形进度条颜色的设置

时间:2011年03月30日 10:28:25 来源: 中国移动开发者社区 作者:xyz_lmn

               xml布局文件需加入如下的进度条构件: 

Java代码:

 

 

  1. <ProgressBar 
     
  2. android:id="@+id/loadProgressBar" 
     
  3. android:indeterminateDrawable="@drawable/progressbar" 
     
  4. android:layout_width="wrap_content" 
     
  5. android:layout_height="wrap_content" />
复制代码


                 其中的indeterminteDrawable属性就是用来设置进度条颜色等属性的,其内容如下:

Java代码:
 

  1. <?xml version="1.0" encoding="utf-8"?> 
     

  2.  

  3.  
  4. <rotate xmlns:android="http://schemas.android.com/apk/res/android" 
     
  5. android:pivotX="50%" android:pivotY="50%" 
     
  6. android:fromDegrees="0" 
     
  7. android:toDegrees="360"> 
     

  8.  

  9.  
  10. <shape 
     
  11. android:shape="ring"
     
  12. android:innerRadiusRatio="3" 
     
  13. android:thicknessRatio="8" 
     
  14. android:useLevel="false"> 
     

  15.  

  16.  
  17. <gradient android:type="sweep" 
     
  18. android:useLevel="false" 
     
  19. android:startColor="#000000" 
     
  20. android:centerColor="#FFFFFF" 
     
  21. android:centerY="0.50" 
     
  22. android:endColor="#FFFF00" />
     

  23.  
  24. </shape>
     

  25.  
  26. </rotate>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值