Android 自定义ProgressDialog(利用anim)(转)

Android <wbr>自定义ProgressDialog(利用anim)

1、建立myprogress.xml在 res/anim中

<?xml version="1.0" encoding="UTF-8"?>
<animation-list 
    android:oneshot="false"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:duration="500" android:drawable="@drawable/progress1" />
    <item android:duration="500" android:drawable="@drawable/progress2" />
    <item android:duration="500" android:drawable="@drawable/progress3" />
    <item android:duration="500" android:drawable="@drawable/progress4" />
</animation-list>

2、在style.xml中

<style name="oaprogress" parent="@android:style/Widget.ProgressBar">
    <item name="android:indeterminateDrawable">@anim/myprogress</item>
    <item name="android:backgroundDimEnabled">true</item>
</style>

3、在layout中

<ProgressBar 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    style="@style/oaprogress"
    />
posted @ 2014-04-23 10:25  myxiaoQ  阅读(135)  评论(0编辑  收藏  举报