自定义进度条

示例一(小点前进):

1 布局:

 

<ProgressBar
                android:id="@+id/news_image_loading"
                android:layout_width="60dip"
                android:layout_height="20dip"
                android:indeterminateDrawable="@anim/news_image_loading"/>

2 动画:

 

news_image_loading.xml

 

<?xml version="1.0" encoding="UTF-8"?>
<animation-list android:oneshot="false"
xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:duration="150" android:drawable="@drawable/new_particulars_upload1" />
  <item android:duration="150" android:drawable="@drawable/new_particulars_upload2" />
  <item android:duration="150" android:drawable="@drawable/new_particulars_upload3" />
  <item android:duration="150" android:drawable="@drawable/new_particulars_upload4" />
  <item android:duration="150" android:drawable="@drawable/new_particulars_upload5" />
</animation-list> 

 

 

示例二(转菊花):

<!-- “自定义进度条”用例 -->
        <ProgressBar
            android:id="@+id/footer_loading"
            android:layout_width="20dip"
            android:layout_height="20dip"
            android:layout_below="@id/message_iv"
            android:indeterminateDrawable="@anim/loading" />

 

<?xml version="1.0" encoding="UTF-8"?>
<animation-list android:oneshot="false"
xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:duration="150" android:drawable="@drawable/qb_tenpay_loading_1" />
  <item android:duration="150" android:drawable="@drawable/qb_tenpay_loading_2" />
  <item android:duration="150" android:drawable="@drawable/qb_tenpay_loading_3" />
  <item android:duration="150" android:drawable="@drawable/qb_tenpay_loading_4" />
  <item android:duration="150" android:drawable="@drawable/qb_tenpay_loading_5" />
  <item android:duration="150" android:drawable="@drawable/qb_tenpay_loading_6" />
  <item android:duration="150" android:drawable="@drawable/qb_tenpay_loading_7" />
  <item android:duration="150" android:drawable="@drawable/qb_tenpay_loading_8" />
  <item android:duration="150" android:drawable="@drawable/qb_tenpay_loading_9" />
  <item android:duration="150" android:drawable="@drawable/qb_tenpay_loading_10" />
  <item android:duration="150" android:drawable="@drawable/qb_tenpay_loading_11" />
  <item android:duration="150" android:drawable="@drawable/qb_tenpay_loading_12" />
</animation-list> 

 

 

图片资源见附件

你可能感兴趣的:(自定义)