在我的项目中,我在我的主题中定义了属性“android:calendarViewStyle”.

@style/Widget.CalendarView.Custom

@color/cs_textcolor

@color/red

@style/TextAppearance.Medium

@style/TextAppearance.Medium

所有风格的可能性是:

> @attr ref android.R.styleable#CalendarView_showWeekNumber

> @attr ref android.R.styleable#CalendarView_firstDayOfWeek

> @attr ref android.R.styleable#CalendarView_minDate

> @attr ref android.R.styleable#CalendarView_maxDate

> @attr ref android.R.styleable#CalendarView_shownWeekCount

> @attr ref android.R.styleable#CalendarView_selectedWeekBackgroundColor

> @attr ref android.R.styleable#CalendarView_focusedMonthDateColor

> @attr ref android.R.styleable#CalendarView_unfocusedMonthDateColor

> @attr ref android.R.styleable#CalendarView_weekNumberColor

> @attr ref android.R.styleable#CalendarView_weekSeparatorLineColor

> @attr ref android.R.styleable#CalendarView_selectedDateVerticalBar

> @attr ref android.R.styleable#CalendarView_weekDayTextAppearance

> @attr ref android.R.styleable#CalendarView_dateTextAppearance

注意:如果showWeekNumber不能用作xml样式,则可以使用setShowWeekNumber(true)在代码中设置.

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐