2017-10-07 5 views
1

내 응용 프로그램에서 RatingBar를 사용합니다. 그림자를 제거하고 싶습니다 (스크린 샷에 밑줄이 그어져 있습니다).하지만 어떻게해야할지 모르겠습니다.RatingBar에서 그림자 사용 안 함

내 스타일 :

<style name="RatingBar" parent="Theme.AppCompat"> 
    <item name="colorControlNormal">@color/colorAccent</item> 
    <item name="colorControlActivated">@color/colorAccent</item> 
    <item name="colorControlHighlight">@color/colorAccent</item> 
    <item name="colorPrimary">@color/colorAccent</item> 
    <item name="colorAccent">@color/colorAccent</item> 
</style> 

가 어떻게 그림자를 제거하는 말해 주시겠습니까?

Shadow in RatingBar

+0

시도해 보았습니다. 귀하의 테마 –

+0

에서 0dp로 표고를 설정해보십시오. 작동하지 않습니다. –

+0

해결책을 찾았습니까? 여기에도 같은 문제에 직면 해 있습니다! –

답변

0

나도 같은 문제에 직면했다. 나는 그것을 알아. 드로어 블 1 인덱스는 그림자 색상을 변경합니다. 실제 채워진 별색보다 훨씬 밝은 색으로 설정할 수 있습니다.

RatingBar ratingBar = footer.findViewById(R.id.ratingBar); 
     LayerDrawable stars = (LayerDrawable) ratingBar.getProgressDrawable(); 
     stars.getDrawable(0).setColorFilter(Color.parseColor("#b0b0b0"), PorterDuff.Mode.SRC_ATOP); 
     stars.getDrawable(1).setColorFilter(Color.parseColor("#fff9ee"), PorterDuff.Mode.SRC_ATOP);// This line changes the color of the shadow under the stars 
     stars.getDrawable(2).setColorFilter(Color.parseColor("#FEBE55"), PorterDuff.Mode.SRC_ATOP); 
     ratingBar.setProgressDrawable(stars);