Skip to content Skip to sidebar Skip to footer

How Can I Change Android Materialcalendarview Month Color?

I'm using Xamarin Android MaterialViewCalendar Month header dissappears on some devices, so I want to set it's color manually.

Solution 1:

Step 1:

In styles add your own style

<stylename="CalendarWidgetHeader"><itemname="android:textSize">18sp</item><itemname="android:textStyle">bold</item><itemname="android:textColor">@color/black</item></style>

Step 2:

calendarView.setHeaderTextAppearance(R.style.CalendarWidgetHeader);

Solution 2:

How can I change Android MaterialCalendarView month color?

When you use MaterialCalendarView, there are three different text appearances you can set :

  • Header

    mcv_headerTextAppearance or setHeaderTextAppearance()

  • Weekday

    mcv_weekDayTextAppearance or setWeekDayTextAppearance()

  • Date

    mcv_dateTextAppearance or setDateTextAppearance()

The header text appearance is used for the topbar month label. The weekday is for the row of weekday labels, and date is for the individual days.

You could use mcv_headerTextAppearance or setHeaderTextAppearance() to set the MaterialCalendarView month color. For more information, you could read he document.

Usage like this :

materialCalendarView.SetHeaderTextAppearance();

or

app:mcv_headerTextAppearance="@style/CustomTextAppearance"

Post a Comment for "How Can I Change Android Materialcalendarview Month Color?"