2017-08-01 107 views
0

我使用的一些設備上Xamarin的Android MaterialViewCalendar enter image description here如何更改Android MaterialCalendarView月份顏色?

月頭dissappears,所以我想將其設置手動的顏色。

<com.prolificinteractive.materialcalendarview.MaterialCalendarView 
    android:id="@+id/calendarView" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="@android:color/white" 
    app:mcv_showOtherDates="all" 
/> 

回答

0

我怎樣才能改變Android的MaterialCalendarView月份的顏色嗎?

當您使用MaterialCalendarView,有三種不同的文字出現,你可以設置:

  • 頁眉

    mcv_headerTextAppearance或setHeaderTextAppearance()

  • 平日

    mcv_weekDayTextAppearance或setWeekDayTextApp earance()

  • 日期

    mcv_dateTextAppearance或setDateTextAppearance()

標題文本外觀用於頂欄月標籤。工作日是針對工作日標籤的行,日期是針對個別日子的。

您可以使用mcv_headerTextAppearancesetHeaderTextAppearance()來設置月份顏色MaterialCalendarView。欲瞭解更多信息,你可以閱讀他document

用法是這樣的:

materialCalendarView.SetHeaderTextAppearance(); 

app:mcv_headerTextAppearance="@style/CustomTextAppearance"