Android/Tip&Tech
ProgressBar 커스터 이미징하기
행복한 수지아빠
2012. 1. 17. 14:28
반응형
출처 :http://pppplqqqq.blog.me/100107860575
ProgressBar 설정
ProgressBar 설정
<ProgressBar android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/progress_load"
style="@style/ProgressBar_Large_new">
</ProgressBar>
styles.xml 파일에 추가 (res/values/styles.xml)
<style name="ProgressBar_Large_new"
parent="@android:style/Widget.ProgressBar">
<item
name="android:indeterminateDrawable">@drawable/progress_large_color</item>
<item name="android:minWidth">76dip</item>
<item name="android:maxWidth">76dip</item>
<item name="android:minHeight">76dip</item>
<item name="android:maxHeight">76dip</item>
</style>
drawable 폴더에 progress_large_color.xml 추가
<?xml version="1.0" encoding="utf-8"?>
<animated-rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/spinner" <!-- 변경할 이미지
-->
android:pivotX="50%"
android:pivotY="50%"
/>
참고 :
android sdk 에 있는 progress_large.xml 를 참고하면
android:framesCount="12"
android:frameDuration="100"
위의 속성을 지정할수 있는데 사용자 지정 이미지로 변경할때는 왜 인지 이 두 속성을 설정할수 없었다.
그래서 기본값으로 주기로 했다.
기본값 참고 : http://idunnolol.com/android/drawables.html
[출처] Android circular Progress 이미지 변경하기 |작성자 곰팅이
반응형