不廢話,直入主題!
創(chuàng)新互聯(lián)公司是一家專業(yè)從事做網(wǎng)站、網(wǎng)站制作的網(wǎng)絡(luò)公司。作為專業(yè)網(wǎng)絡(luò)公司,創(chuàng)新互聯(lián)公司依托的技術(shù)實(shí)力、以及多年的網(wǎng)站運(yùn)營(yíng)經(jīng)驗(yàn),為您提供專業(yè)的成都網(wǎng)站建設(shè)、成都營(yíng)銷網(wǎng)站建設(shè)及網(wǎng)站設(shè)計(jì)開發(fā)服務(wù)!
有兩種方法,一種是調(diào)用系統(tǒng)自身,另一種就是自定義了。
方法一:
在Activity的onCreate()方法中,在super.onCreate(savedInstanceState);之后,在setContentView之前添加下面一行代碼:requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
在需要顯示進(jìn)度時(shí)調(diào)用 setProgressBarIndeterminateVisibility(true);
在要停止顯示時(shí)調(diào)用 setProgressBarIndeterminateVisibility(false);
方法二:
如果覺得系統(tǒng)的不好看,可以自己添加控件ProgressBar到標(biāo)題欄,再在需要顯示或不顯示的時(shí)候調(diào)用setVisibility方法即可;
例如,我的ProgressBar控件是這樣的:
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminateDrawable="@drawable/loading_progress"
android:indeterminateOnly="true"
android:indeterminateBehavior="repeat"
/>
loading_progress.xml內(nèi)容如下:
<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/loading"
android:pivotX="50%"
android:pivotY="50%" />
相信大家都知道該怎么用了吧?再不明白就留言吧!
當(dāng)前題目:Android標(biāo)題欄顯示進(jìn)度條
文章來源:http://aaarwkj.com/article0/pdhpoo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站營(yíng)銷、網(wǎng)站導(dǎo)航、自適應(yīng)網(wǎng)站、虛擬主機(jī)、定制開發(fā)、品牌網(wǎng)站設(shè)計(jì)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)