2014-04-18 5 views
2

진행률 표시 줄을 둥글게 만들려고합니다. 배경은 잘 작동하지만 진행률 표시 줄 (오렌지색)은 둥글게 보이지 않습니다. Progressbar의 둥근 진행 막대 - Android

내 응용 프로그램의 이미지 :

enter image description here

이 내가 원하는 무엇인가 :

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > 
<item android:id="@android:id/background"> 
    <shape> 
     <corners android:radius="13dip" /> 
     <gradient 
      android:angle="270" 
      android:centerColor="#ff747674" 
      android:centerY="0.5" 
      android:endColor="#ff9d9e9d" 
      android:startColor="#ff9d9e9d" /> 
    </shape> 
</item> 

<item android:id="@android:id/progress"> 
    <clip> 
     <shape> 
      <corners 
       android:radius="13dip" /> 
      <gradient 
       android:startColor="#f3c30b" 
       android:centerColor="#efa200" 
       android:centerY="0.5" 
       android:endColor="#ce7428" 
       android:angle="270" 
       /> 
     </shape> 
    </clip> 
</item> 
:

enter image description here

이 내 진행 막대의 코드

+0

ClipDrawable을 사용하면 반올림 된 Drawable이 자르므로 오른쪽 반올림을 볼 수없는 이유, 레벨 변경을 위해 사용자 지정 Drawable 리크를 사용할 수 있습니다. – pskink

+0

나에게 예제를 들려 줄 수 있습니까? –

+0

클래스 D는 Drawable {...을 확장하고 onLevelChange를 override하여 invalidateSelf를 호출하여 setLevel을 호출하면 Drawable이 무효화됩니다. – pskink

답변

0

<clip>..</clip><scale android:scaleWidth="100%">..</scale>으로 바꿉니다.