2016-06-17 4 views
0

これは、通常のロード「の画像は、」ui androidをカスタマイズする方法は?

enter image description here またはenter image description here

がどのように我々は最初に置き換えるん..それを変更私は例えば、カスタマイズしたいアンドロイド enter image description here

に示されていますそれらのための読み込み?私たちは写真が必要ですか?またはいくつかのXMLファイル?

答えて

0

のres/layout.xml

<ProgressBar 
    android:id="@+id/progressBar" 
      style="?android:attr/progressBarStyleLarge" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_centerHorizontal="true" 
      android:layout_centerVertical="true" 
      android:visibility="gone" 
      android:indeterminateDrawable="@drawable/progress" > 
     </ProgressBar> 



drawable/progress.xml This is a custom ProgressBar that i use to change the default colors. 

<?xml version="1.0" encoding="utf-8"?> 

<!-- 
    Duration = 1 means that one rotation will be done in 1 second. leave it. 
    If you want to speed up the rotation, increase duration value. 
    in example 1080 shows three times faster revolution. 
    make the value multiply of 360, or the ring animates clunky 
--> 
<rotate xmlns:android="http://schemas.android.com/apk/res/android" 
    android:fromDegrees="0" 
    android:pivotX="50%" 
    android:pivotY="50%" 
    android:duration="1" 
    android:toDegrees="360" > 

    <shape 
     android:innerRadiusRatio="3" 
     android:shape="ring" 
     android:thicknessRatio="8" 
     android:useLevel="false" > 
     <size 
      android:height="48dip" 
      android:width="48dip" /> 

     <gradient 
      android:centerColor="@color/color_preloader_center" 
      android:centerY="0.50" 
      android:endColor="@color/color_preloader_end" 
      android:startColor="@color/color_preloader_start" 
      android:type="sweep" 
      android:useLevel="false" /> 
    </shape> 

</rotate> 
関連する問題