你给我们提供了很棒的工具!
我喜欢日历下面的这张表。它真的很有用。我遇到的唯一问题是自定义日历视图...我需要更干净的东西。你有什么建议可以让我开始定制视图吗?
我正在寻找类似这样的东西:https://github.com/jonathantribouharet/JTCalendar/blob/master/Screens/example.gif
提前感谢!
发布于 2015-04-09 09:18:45
您需要查看CKCalendarCell和CKCalendarHeaderView类。
单元格和标题的外观和感觉都在那里。
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:方法。您可能希望添加您自己的borderRadius和clipsToBounds值。
标题的颜色在CKCalendarHeaderColors.h中定义为十六进制值,并在NSString上转换为带有类别的UIColors。
https://stackoverflow.com/questions/29420486
复制相似问题