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. 如何儀器類加載自定義類加載器?
- 3. 如何實現自定義進度條
- 4. 如何設計自定義進度欄?
- 5. Feed.ly如何確定iFrame加載進度?
- 6. 項目寬度加載自定義yml
- 7. 在自定義DialogPreference中加載列表視圖之前加載進度條
- 8. 如何使自動加載進度欄重定向?
- 9. Android - 自定義進度條
- 10. Webapp - 自定義進度條
- 11. 如何在iphone中添加自定義加載器
- 12. 如何自定義容器寬度
- 13. geoxml3:如何加載自定義圖標
- 14. 如何加載自定義字體?
- 15. actionscript:如何自定義加載動畫
- 16. 如何加載XML以在Android上進行自定義分析?
- 17. android下載器,我如何自定義
- 18. Constructor.newInstance中的自定義類加載器
- 19. PropertyPlaceholderConfigurer與自定義類加載器
- 20. PHP自定義類加載器
- 21. 「NegativeArraySizeException」 - 自定義類加載器
- 22. 自定義加載指示器(微調)
- 23. Solr不加載自定義過濾器
- 24. Java自定義類加載器
- 25. SAPUI5中的自定義Gif加載器
- 26. 自定義自動完成進度條
- 27. 如何將Blazeds與自定義類加載器一起使用?
- 28. 如何編寫自定義的類加載器來從jar中加載類?
- 29. 自定義UICollectionViewCell未加載
- 30. 加載CodeIgniter自定義庫
但接下來的時間,創造一個更美好搜索: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