I have a CalendarView
in my app. But I would like to have the background of the CalendarView
black and the text inside the CalendarView
white. But in xml there is no TextColor=
in the CalendarView
. So how can I change the text of the CalendarView
?
I have tried every solution on StackOverflow and the internet so far. I've managed to change the color of the days in the CalendarView but not the month and year.
I've tried both methods in this post: Set the text color of calendar view month name
And I've tried this method: Change CalendarView style
And some other I found on the internet but nothing was succesfull.
Set style in your CalendarView
<CalendarView
android:id="@+id/calendarView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:theme="@style/CalenderViewCustom"
android:dateTextAppearance="@style/CalenderViewDateCustomText"
android:weekDayTextAppearance="@style/CalenderViewWeekCustomText" />
Inside Style.xml
<style name="CalenderViewCustom" parent="Theme.AppCompat">
<item name="colorAccent">@color/red</item>
<item name="colorPrimary">@color/white</item>
</style>
<style name="CalenderViewDateCustomText" parent="android:TextAppearance.DeviceDefault.Small">
<item name="android:textColor">@color/white</item>
<item name="android:weekNumberColor">@color/red</item>
</style>
<style name="CalenderViewWeekCustomText" parent="android:TextAppearance.DeviceDefault.Small">
<item name="android:textColor">@color/white</item>
</style>