0

您提供给我们的好工具!

我喜欢日历下方的表格。它非常有用。我遇到的唯一问题是自定义日历视图......我需要一些更清洁的东西。你有提示我可以开始寻找自定义视图吗?

我正在寻找这样的东西:https ://github.com/jonathantribouharet/JTCalendar/blob/master/Screens/example.gif

提前致谢!

4

1 回答 1

1

你想看看CKCalendarCellCKCalendarHeaderView类。

单元格和标题的外观和感觉在那里。

CKCalendarCell 使用状态的概念来确定何时渲染什么。有七种状态:

CKCalendarMonthCellStateTodaySelected = 0,      //  Today's cell, selected
CKCalendarMonthCellStateTodayDeselected = 1,    //  Today's cell, unselected
CKCalendarMonthCellStateNormal,                 //  Cells that are part of this month, unselected
CKCalendarMonthCellStateSelected,               //  Cells that are part of this month, selected
CKCalendarMonthCellStateInactive,               //  Cells that are not part of this month
CKCalendarMonthCellStateInactiveSelected,       //  Transient state for out of month cells
CKCalendarMonthCellStateOutOfRange              //  A state for cells that are bounded my min/max constraints on the calendar picker 

每个单元格的状态是根据它是否属于当前月份、单元格是否被选中以及单元格中是否有活动触摸来确定的。

看看applyColorsForState:着色和东西的方法。您可能想要添加自己的值borderRadiusclipsToBounds值。

标题的颜色被定义CKCalendarHeaderColors.h为十六进制值,这些值被转换为具有 NSString 类别的 UIColors。

于 2015-04-09T01:18:44.583 回答