zoukankan      html  css  js  c++  java
  • 利用ProgressBar实现旋转loading动画

    1.resanim.loading.xml

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/layout_loading"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center">
    
            <ProgressBar
                android:id="@+id/progress_bar"
                android:layout_width="100dp"
                android:layout_height="100dp"
                style="@style/progressbar_style"/>
            <TextView
                android:layout_width="100dp"
                android:layout_height="wrap_content"
                android:layout_below="@+id/progress_bar"
                android:lines="1"
                android:text="等待蓝牙连接……"
                android:textSize="8sp"
                android:gravity="center"/>
        </RelativeLayout>
    
    </LinearLayout>
    

    2.valuesStyle.xml

       <!-- loading 动画-->
        <style name="progressbar_style">
            <item name="android:maxWidth">50.0dip</item>
            <item name="android:maxHeight">50.0dip</item>
            <item name="android:indeterminateDrawable">@anim/anim_loading</item>
            <item name="android:minWidth">50.0dip</item>
            <item name="android:minHeight">50.0dip</item>
        </style>
    

     3. animanim.loading.xml

    <?xml version="1.0" encoding="utf-8"?>
    <rotate xmlns:android="http://schemas.android.com/apk/res/android"
        android:drawable="@drawable/loading"
        android:fromDegrees="-720"
        android:duration="400"
        android:toDegrees="0"
        android:pivotX="50.0%"
        android:pivotY="50.0%"/>
    

      

      

  • 相关阅读:
    Codeforces Round #239(Div. 2) 做后扯淡玩
    hdu 3507 Print Article
    prufer序列
    POJ 2778 DNA Sequence
    Codeforces Round #237 (Div. 2)
    poj3352
    图论知识
    POJ 2186
    Codeforces Round #236 (Div. 2)
    POJ 2823 Sliding Window
  • 原文地址:https://www.cnblogs.com/galibujianbusana/p/8762403.html
Copyright © 2011-2022 走看看