3
A
回答
5
我用這個像你
Dialog dialog = new Dialog(context,R.style.LoadingDialogTheme);
dialog.setContentView(R.layout.loading);
dialog.setCancelable(false);
dialog.show();
dialog.findViewById(R.id.loading_icon).startAnimation(AnimationUtils.loadAnimation(InitActivity.this, R.anim.rotate360));
}
/RES /動畫/ rotate360負載。 xml
<?xml version="1.0" encoding="UTF-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<rotate
android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:duration="2000"
android:repeatCount="infinite" />
</set>
/res/layout/loading.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:background="@color/loadingBackground">
<ImageView
android:id="@+id/loading_icon"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_loading"/>
<TextView
android:id="@+id/loading_text"
android:layout_gravity="center"
android:text="Loading"
android:gravity="center"
android:textSize="18dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="3dip"
android:textColor="@color/info"
android:layout_below="@+id/loading_icon"/>
</TextView>
那麼你必須做的是讓你的禮物的一幀,並使用它像loading_icon.png
祝你工作:)
相關問題
- 1. 如何在加載時加載自定義進度欄
- 2. Android加載進度條帶自定義圖像和進度指示器
- 3. 如何在composer中定義自定義自動加載器?
- 4. 如何儀器類加載自定義類加載器?
- 5. 自定義進度
- 6. 如何實現自定義進度條
- 7. 如何設計自定義進度欄?
- 8. 如何自定義矩形進度條?
- 9. Feed.ly如何確定iFrame加載進度?
- 10. 項目寬度加載自定義yml
- 11. 自定義水平進度條與自定義選擇器
- 12. 在自定義DialogPreference中加載列表視圖之前加載進度條
- 13. 如何使自動加載進度欄重定向?
- 14. Android - 自定義進度條
- 15. 自定義進度條
- 16. 自定義平進度條
- 17. Webapp - 自定義進度條
- 18. 如何自定義容器寬度
- 19. 如何在iphone中添加自定義加載器
- 20. actionscript:如何自定義加載動畫
- 21. 如何加載自定義字體?
- 22. geoxml3:如何加載自定義圖標
- 23. 如何加載自定義函數
- 24. 如何加載XML以在Android上進行自定義分析?
- 25. 如何激活一個Hibernate加載程序進行自定義加載?
- 26. 使用自定義自動加載器加載php核心類
- 27. android下載器,我如何自定義
- 28. 自定義加載指示器(微調)
- 29. PHP自定義類加載器
- 30. PropertyPlaceholderConfigurer與自定義類加載器
但接下來的時間,創造一個更美好搜索:P – 2011-12-21 13:40:07
這一個我已經使用,有一個看起來不像加載程序的問題。每輪旋轉都會暫停。而不是這個360旋轉的動畫沒有其他的去? – arnp 2011-12-21 13:59:51
在對話框中嘗試使用上升的線程優先級,使用:Thread.currentThread()。setPriority(Thread.MAX_PRIORITY); – 2011-12-22 07:14:32