【发布时间】:2019-10-24 18:19:24
【问题描述】:
我正在尝试在我的CalendarView 中制作以下样式:
我设法做的是:
问题是我站在的日期是白色的,标记也是白色的。
例如,如何将特定日期的颜色更改为黑色?
我的 xml 是:
<CalendarView
android:id="@+id/cv_BorrowCalendar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/cv_background"
android:theme="@style/CalenderViewCustom"
android:dateTextAppearance="@style/CalenderViewDateCustomText"
android:weekDayTextAppearance="@style/CalenderViewWeekCustomText"
app:layout_constraintBottom_toTopOf="@+id/bottom_navigation"
app:layout_constraintTop_toBottomOf="@+id/rv_Borrowing" />
在样式中:
<!-- Calendar -->
<style name="CalenderViewCustom" parent="Theme.AppCompat">
<item name="colorAccent">@color/colorWhite</item>
<item name="colorPrimary">@color/colorWhite</item>
</style>
<style name="CalenderViewDateCustomText" parent="android:TextAppearance.DeviceDefault.Small">
<item name="android:textColor">@color/colorWhite</item>
<item name="android:weekNumberColor">@color/colorLightPurple</item>
</style>
<style name="CalenderViewWeekCustomText" parent="android:TextAppearance.DeviceDefault.Small">
<item name="android:textColor">@color/colorWhite</item>
</style>
此外,如果有办法将日期名称更改为 sun 而不是 s 或 mon 而不是 m,那么很高兴知道 =] 谢谢
【问题讨论】:
-
不应该把这个:
<item name="android:textColor">@color/colorWhite</item>改成:<item name="android:textColor">#000000</item> -
ye 但它要么全部改变,要么不改变。我希望所有日期都以白色显示,除了白色圆圈的日期。
-
有一个库,你可以自定义几乎所有东西,而且它是开源的,所以你可以在任何情况下修改源代码:github.com/ArchitShah248/CalendarDateRangePicker
标签: android android-view android-xml android-styles calendarview