[android/Kotlin] androidx.appcompat.widget.SwitchCompat 색 안바뀌는 버그

love&peace·2023년 9월 29일

문제 : switchCompat에 track, thumb의 커스텀한 색이 바뀌지 않았다.


해결 방법 : app:trackTint 와 app:thumbTint의 "@null"을 준다.

  <androidx.appcompat.widget.SwitchCompat
        ```  android:layout_marginStart="8dp"
            android:id="@+id/includeSwitch"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="24dp"
            android:thumb="@drawable/switch_thumb_state"
            app:track="@drawable/switch_state"
            app:trackTint="@null"
            app:thumbTint="@null"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/includeToggleT"
            app:layout_constraintTop_toTopOf="parent" />
            

0개의 댓글