我正在Android Studio中对CalendarView进行样式设置,并且已经实现了更改所选颜色的功能
具有以下代码:
布局:
<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>
问题是我的结果没有显示结果中所显示的年份和月份:
我已经尝试更改headerHeaderMonthTextApperance之类的标头属性,但似乎对我没有任何帮助。
您好,您不能使用此库
完整的性能和可自定义的
<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"
/>