无法覆盖安卓颜色资源



我正在使用此库https://github.com/savvisingh/daterangepicker。我会覆盖选定日的默认颜色,我声明了这些颜色资源:

<color name="calendar_selected_day_bg">@color/colorPrimary</color>
<color name="calendar_selected_range_bg">@color/colorPrimary</color>
<color name="dateTimeRangePickerStateToday">@color/colorPrimary</color>

"今日"的颜色正确正确,但是选定日的颜色仍然为默认颜色(黄色(,您是否知道为什么会发生?

添加覆盖标志,例如bellow

xmlns:tools="http://schemas.android.com/tools"
       tools:override="true"

到您的颜色标签。

例如。

<color name="calendar_selected_day_bg" xmlns:tools="http://schemas.android.com/tools"
           tools:override="true">@color/colorPrimary</color>

最新更新