首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何自定义您的MBCalendarKit?

如何自定义您的MBCalendarKit?
EN

Stack Overflow用户
提问于 2015-04-03 02:59:52
回答 1查看 125关注 0票数 0

你给我们提供了很棒的工具!

我喜欢日历下面的这张表。它真的很有用。我遇到的唯一问题是自定义日历视图...我需要更干净的东西。你有什么建议可以让我开始定制视图吗?

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

提前感谢!

EN

回答 1

Stack Overflow用户

发布于 2015-04-09 09:18:45

您需要查看CKCalendarCellCKCalendarHeaderView类。

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

CKCalendarCell使用状态的概念来确定在什么时候呈现什么。有七种状态:

代码语言:javascript
复制
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。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29420486

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档