Android layout 如何改变今天';s日期颜色android CanlendarView
我为Android layout 如何改变今天';s日期颜色android CanlendarView,android-layout,android-styles,calendarview,Android Layout,Android Styles,Calendarview,我为日历视图创建了一些自定义样式,以更改文本颜色: <style name="CalenderViewCustom" parent="Theme.AppCompat"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorAccent">@co
日历视图
创建了一些自定义样式
,以更改文本颜色:
<style name="CalenderViewCustom" parent="Theme.AppCompat">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorAccent">@color/colorAccentYellow</item>
<item name="android:textColorPrimary">@color/colorPrimaryDarker</item>
</style>
@颜色/原色
@颜色/颜色/黄色
@颜色/原色较深
并将其应用到日历中,如下所示:
<CalendarView
...
android:theme="@style/CalenderViewCustom"
android:dateTextAppearance="@style/CalenderViewDateCustomText"
android:weekDayTextAppearance="@style/CalenderViewWeekCustomText"
...
/>
我想将文本颜色“9”更改为与背景颜色“16”不同的颜色。目前,它们都是由
colorAccent
属性确定的
是否有任何其他属性只会单独更改其中一个属性?找到了一个非常酷的解决方案:
我们可以使用这个软件包,它有点旧,但仍然可以很好地工作(Android 26+) 例如,要将“今日”颜色设置为黑色:
<com.github.sundeepk.compactcalendarview.CompactCalendarView
android:layout_width="match_parent"
android:layout_height="280dp"
...
app:compactCalendarCurrentDayTextColor="@android:color/black"
...
/>
找到了一个非常酷的解决方案:
我们可以使用这个软件包,它有点旧,但仍然可以很好地工作(Android 26+) 例如,要将“今日”颜色设置为黑色:
<com.github.sundeepk.compactcalendarview.CompactCalendarView
android:layout_width="match_parent"
android:layout_height="280dp"
...
app:compactCalendarCurrentDayTextColor="@android:color/black"
...
/>
那么您希望今天的日期文本颜色应该不同,而选定的日期背景应该不同?@Wini是,准确地说:)那么您希望今天的日期文本颜色应该不同,而选定的日期背景应该不同?@Wini是,准确地说:)