activity_main.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <LinearLayout android:paddingLeft="16dp" android:paddingRight="16dp" android:paddingBottom="8dp" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content"> <!-- 프로그레스바 --> <ProgressBar android:max="100" android:progress="50" style="@style/Widget.AppCompat.ProgressBar.Horizontal" android:progressDrawable="@drawable/progressbar_progressbar1" android:layout_width="match_parent" android:layout_height="12dp" /> <!--// 프로그레스바 --> </LinearLayout> |
drawable폴더 > progressbar_progressbar1.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <shape> <corners android:radius="6dp" /> <solid android:color="#D5D5D5" /> </shape> </item> <item android:id="@android:id/secondaryProgress"> <clip> <shape> <corners android:radius="6dp" /> <solid android:color="#B2CCFF" /> </shape> </clip> </item> <item android:id="@android:id/progress"> <clip> <shape> <corners android:radius="6dp" /> <solid android:color="#6799FF" /> </shape> </clip> </item> </layer-list> | cs |
<clip>을 써야 progress 속성이 먹힌다
모서리를 둥글게하고 배경색을 줌
결과
'IT > - 프로그래밍' 카테고리의 다른 글
안드로이드 홈화면(배경화면)으로 이동하기 (1) | 2016.08.09 |
---|---|
안드로이드 시크바(SeekBar) 커스텀하기 (0) | 2016.08.08 |
안드로이드/ANDROID 폰인지 태블릿인지 판단하기 (0) | 2016.08.06 |
[안드로이드/ANDROID] 액션바 커스텀하기 : ActionBar Custom (1) | 2016.08.06 |
[안드로이드/ANDROID] GPS ON/OFF 확인해서 OFF이면 설정화면으로 이동하기 (0) | 2016.08.04 |