1. res/values/style.xml에서 다음과 같이 코드를 쓴다.
<style name="RatingBar" parent="Theme.AppCompat">
<item name="colorControlNormal">@color/gray</item>
<item name="colorControlActivated">@color/colorPrimary</item></style>
colorControlNormal에선 안 채워졌을 때의 색을,
colorControlActivated에선 채워졌을 때의 색을 넣으면 된다.
2. layout RatingBar에 다음과 같이 theme을 적용해준다.
android:theme="@style/RatingBar"
참고:
https://stackoverflow.com/questions/39913495/ratingbar-color-difference-on-different-devices
RatingBar color difference on different devices
I have a RatingBar <android.support.v7.widget.AppCompatRatingBar android:id="@+id/rating" android:layout_width="wrap_content" android:layout_height="
stackoverflow.com
'안드로이드 노트' 카테고리의 다른 글
[안드로이드][프로젝트2] disabled ratingbar 만들기 + ratingbar 크기 줄이기 (0) | 2022.04.27 |
---|---|
[안드로이드][프로젝트2]BottomNavigationView 색상 변경하는 법 (0) | 2022.04.10 |
[안드로이드][프로젝트2] 투명한 Activity 만드는 방법 (0) | 2022.04.09 |
[안드로이드][프로젝트2] html 태그 없애는 법 (0) | 2022.04.07 |
[안드로이드][프로젝트2] TextView 긴 문자열 생략해서 표시하기 (0) | 2022.04.07 |