제작 해보겠습니다.
main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ProgressBar android:id="@+id/progress_horizontal"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:max="100"
android:progress="50"
android:secondaryProgress="75" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/progressbar_1_default_progress" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button android:id="@+id/decrease"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/progressbar_1_minus" />
<Button android:id="@+id/increase"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/progressbar_1_plus" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/progressbar_1_secondary_progress" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button android:id="@+id/decrease_secondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/progressbar_1_minus" />
<Button android:id="@+id/increase_secondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/progressbar_1_plus" />
</LinearLayout>
</LinearLayout>
style="?android:attr/progressBarStyleHorizontal" <- 막대모양 progressBar를 사용합니다.
android:max="100" <- max값을 100으로 지정
android:progress="50" <- 진행상태를 50으로 합니다.
android:secondaryProgress="75" /> <- second Progress는 75로 합니다.
ProgressBar1.JAVA
'프로그래밍 > Android' 카테고리의 다른 글
[Android]AdMob 광고를 달아보자(3) (0) | 2010.12.14 |
---|---|
[Android] PowerManager (절전, 조명 관련) (0) | 2010.10.04 |
[Android]APIDemo ProgressBar 제작(UI 저장) (0) | 2010.10.02 |
[Android]AdMob 광고를 달아보자(2) (0) | 2010.10.02 |
[Android]AdMob 광고를 달아보자(1) (0) | 2010.10.02 |