2012-03-16 36 views

Trả lời

19

Ở đây câu trả lời của tôi, tôi sử dụng hình ảnh của tôi trong thanh tiến trình android ..

<ProgressBar 
     android:layout_width="60dp" 
     android:layout_height="50dp" 
     android:layout_centerInParent="true" 
     android:indeterminate="true" 
     android:indeterminateDrawable="@drawable/my_progress_indeterminate" /> 

my_progress_indeterminate.xml:

<?xml version="1.0" encoding="utf-8"?> 
    <animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" 
     android:drawable="@drawable/animation" 
     android:pivotX="50%" 
     android:pivotY="50%"/> 

animation.xml:

<?xml version="1.0" encoding="utf-8"?> 
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" 
    android:oneshot="false"> 

    <item android:drawable="@drawable/load" android:duration="50" /> 
    <item android:drawable="@drawable/load" android:duration="50" /> 
    <item android:drawable="@drawable/load" android:duration="50" /> 
    <rotate 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:drawable="@drawable/load" 
     android:pivotX="50%" 
     android:pivotY="50%" 
     android:fromDegrees="330" 
     android:toDegrees="360" 
     android:repeatCount="1" />  

</animation-list> 
+0

android: drawable = "@ drawable/load" là gì? – itzhar

+0

đó là một hình ảnh có thể kéo được load.png @itzhar – Hamid

+5

bạn sử dụng animatio.xml ở đâu? – Hamid

Các vấn đề liên quan