Android编程实现自定义进度条颜色的方法

2019-12-10 19:50:30丽君
  • <clip >   <shape >  
  • <corners android:radius="0dip" />   <gradient 
  • android:angle="270"  android:centerY="0.75" 
  • android:endColor="#165CBC"  android:startColor="#85B0E9" />  
  • </shape>   </clip>  
  • </item>   <item android:id="@android:id/progress">  
  • <clip >   <shape >  
  • <corners android:radius="5dip" />   <gradient 
  • android:angle="270"  android:centerY="0.75" 
  • android:endColor="#165CBC"  android:startColor="#85B0E9" />  
  • </shape>   </clip>  
  • </item>   </layer-list> 
  • <layer-list xmlns:android="http://www.easck.com/apk/res/android" >   <item android:id="@android:id/background">  
  • <shape >   <corners android:radius="5dip" />  
  • <gradient  android:angle="270" 
  • android:centerY="0.75"  android:endColor="#F5F5F5" 
  • android:startColor="#BEBEBE" />   </shape>  
  • </item>   <item android:id="@android:id/secondaryProgress">  
  • <clip >   <shape >  
  • <corners android:radius="0dip" />   <gradient 
  • android:angle="270"  android:centerY="0.75" 
  • android:endColor="#165CBC"  android:startColor="#85B0E9" />  
  • </shape>   </clip>  
  • </item>   <item android:id="@android:id/progress">  
  • <clip >   <shape >  
  • <corners android:radius="5dip" />   <gradient 
  • android:angle="270"  android:centerY="0.75" 
  • android:endColor="#165CBC"  android:startColor="#85B0E9" />