Android CalendarView Год Цвет текста - PullRequest
0 голосов
/ 28 апреля 2020

Я создаю стиль CalendarView в Android Studio, и мне уже удалось изменить выбранный цвет

с помощью следующего кода:

макет:

<CalendarView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/CalenderViewCustom"
        android:dateTextAppearance="@style/CalenderViewDateCustomText"
        android:weekDayTextAppearance="@style/CalenderViewWeekCustomText">
    </CalendarView>

styles. xml:

<style name="CalenderViewCustom" parent="Theme.AppCompat">
        <item name="colorAccent">@color/mainSelectedColor</item>
    </style>

    <style name="CalenderViewDateCustomText" parent="android:TextAppearance.DeviceDefault.Small">
        <item name="android:textColor">@color/colorBlack</item>
    </style>

    <style name="CalenderViewWeekCustomText" parent="android:TextAppearance.DeviceDefault.Small">
        <item name="android:textColor">@color/colorBlack</item>
    </style>

Проблема в том, что мой результат не показывает год и месяц, как вы видите в результате:

enter image description here

Я уже пытался изменить атрибуты заголовка, такие как headerMonthTextApperance, но, похоже, у меня ничего не работает.

1 Ответ

0 голосов
/ 28 апреля 2020

Привет, ты не можешь использовать эту библиотеку

https://github.com/SundeepK/CompactCalendarView

полная производительность и возможность настройки

<com.github.sundeepk.compactcalendarview.CompactCalendarView
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/compactcalendar_view"
        android:layout_width="fill_parent"
        android:paddingRight="10dp"
        android:paddingLeft="10dp"
        android:layout_height="250dp"
        app:compactCalendarTargetHeight="250dp"
        app:compactCalendarTextSize="12sp"
        app:compactCalendarBackgroundColor="#ffe95451"
        app:compactCalendarTextColor="#fff"
        app:compactCalendarCurrentSelectedDayBackgroundColor="#E57373"
        app:compactCalendarCurrentDayBackgroundColor="#B71C1C"
        app:compactCalendarMultiEventIndicatorColor="#fff"
        />
...