android自定义progressbar图片大小自适应

来源:互联网 发布:软件开发源代码管理 编辑:程序博客网 时间:2024/05/14 06:44
通过animation-list 动画自定义的progressbar样式,如果progressbar设置的长度和宽度超过了动画中图片的大小,效果会很难看,通过如下方式可解决。
  1. <animation-list xmlns:android="http://schemas.android.com/apk/res/android"  
  2.     android:variablePadding="true" >   
  3.   
  4.     <item android:duration="40">   
  5.         <clip   
  6.             xmlns:android="http://schemas.android.com/apk/res/android"  
  7.             android:clipOrientation="horizontal"  
  8.             android:drawable="@drawable/loading_70px_001"  
  9.             android:gravity="left" >   
  10.         </clip>   
  11.     </item>   
  12.     <item android:duration="40">   
  13.         <clip   
  14.             xmlns:android="http://schemas.android.com/apk/res/android"  
  15.             android:clipOrientation="horizontal"  
  16.             android:drawable="@drawable/loading_70px_100"  
  17.             android:gravity="left" >   
  18.         </clip>   
  19.     </item>   
  20.   
  21. </animation-list>  
原创粉丝点击