Loader - Gooey light效果在android中

时间:2015-08-17 12:46:40

标签: android

我在下面看到了像图片链接一样的加载光标。我的问题是如何使用Java或XML创建它以便在Android应用程序中使用。

Loader Gif Image

1 个答案:

答案 0 :(得分:1)

Hi Mehrdad Safari,

     Try this code with required image inserting in animation_code.xml.

1)用于显示加载器的XML文件

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/loadingPanel"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center" >

    <ProgressBar
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:indeterminate="true"
        android:indeterminateDrawable="@drawable/animation_code" />

</RelativeLayout>

2)animation_code:

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

     />