progressbar 나 seekbar의 background를 커스텀으루 주고 싶을 땐 drawable폴더에 **.xml 파일을 만듭니다.

 

이 파일을 android:background="@drawable/***" 로 주시면 됩니다.

 

ex)

 

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
  android:id="@android:id/background"
  android:drawable="@drawable/progress_bg">
 </item>

    <item android:id="@android:id/secondaryProgress">
        <clip android:drawable="@drawable/progress"/>
    </item>

    <item android:id="@android:id/progress">
        <clip android:drawable="@drawable/progress"/>
    </item>
</layer-list>

 

특이사항이 있는데 android:id="@android:id/background" 에서는 <clip> 을 주지 않는 다는 점입니다.

 

background에는 <clip>을 주지 않고 secondaryProgress와 progress에서는 <clip>에서 drawable을 지정해 주어야합니다.

 

이렇게 해야 잘 나옴 ㅋ

 

또하나의 팁을 드리자면

 

seekbar의 background 이미지를 nine-patch로 주고 seekthumb의 이미지를 주었을 경우에 bar와 thumb의 싱크가 맞지 않는데

 

이럴 경우에 xml에서 seekbar 속성에 android:maxHeight를 주면 됩니다

 

소소한 팁-0- 끝~