How to make custom Indeterminate ProgressBar

痞子三分冷 提交于 2019-12-04 17:15:57

I got the android source code so I saw how they build de spinner loader, and it's very eassy just two steps

1- create a drawable resource in your drawable folder with you image like below (and named it f.i my_loader)

<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:drawable="@drawable/your_image_loader"
    android:pivotX="50%"
    android:pivotY="50%" />

2- in your layout

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:orientation="vertical" >

    <ProgressBar
        android:id="@+id/progressBar1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:indeterminateDrawable="@drawable/my_loader" />
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!