java Android日历视图设置颜色,没有不推荐的方法 11 月,4 周 Questions & Answers 94 在我的安卓项目中,我有白色背景的calendarView,我只想将日历中的所有日期设置为黑色,但找不到如何设置
# 1 楼答案 时尚。xml使用这个 <style name="BlueCalenderView" > <item name="colorAccent">@color/desired_color</item> </style> 如果你想改变天的颜色 <style name="CalenderViewDateCustomText" parent="android:TextAppearance.DeviceDefault.Small"> <item name="android:textColor">@color/desired_color</item> </style> 如果你想改变星期的颜色 <style name="CalenderViewWeekCustomText" parent="android:TextAppearance.DeviceDefault.Small"> <item name="android:textColor">@color/desired_color</item> </style> 最后,在布局中: <CalendarView android:id="@+id/calendar" android:theme="@style/BlueCalenderView" android:weekDayTextAppearance="@style/CalenderViewWeekCustomText" android:dateTextAppearance="@style/CalenderViewDateCustomText" ..... />
# 1 楼答案
时尚。xml使用这个
如果你想改变天的颜色
如果你想改变星期的颜色
最后,在布局中: