Android自學筆記之ProgressBar進度條的屬性、常用方法及使用

1,屬性: 
 android:progress="0"  ----設置第一層進度條的初始值
 android:max="100"  ---設置進度條的最大值
 android:secondaryProgress="10"  --設置第二層進度條的初始值


2.進度條的常用方法:
int getMax():返回這個進度條的最大值
int getProgress();返回進度條當前進度
int getSecondProgress():返回當前次要進度
void incrementProgressBy(int diff):指定增加的進度,每次推進的步伐
boolean isInderterminate():指示進度條是否在不確定模式下
void setIndeterminate(boolean indeterminate):設置不確定模式下,用於無法確定時間任務

void setVisibility(int v):設置該進度條是否可視。

3.使用

 <span style="font-family:KaiTi_GB2312;"><ProgressBar
        style="?android:attr/progressBarStyleLarge"
        android:layout_width="wrap_content"
        android:layout_height="50sp"
        android:progress="0"
        android:max="100"
        android:secondaryProgress="10"
        android:id="@+id/progressBar"
        android:layout_below="@+id/progressBar"
        android:layout_alignBottom="@+id/progressBar" /></span>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章