简体   繁体   English

如何向Tapku日历添加活动?

[英]How can I add events to Tapku Calendar?

I've attached the Tapku Calendar to my project. 我已将Tapku日历附加到我的项目中。 It works great. 它很棒。 But I have to add events to my calendar from RSS or JSON data. 但我必须从RSS或JSON数据向我的日历添加事件。 I didn't see any method in Tabku Lib about this issue. 我没有在Tabku Lib中看到有关此问题的任何方法。

How can I add events to Tapku Calendar? 如何向Tapku日历添加活动?

I've worked with both TapKu and Kal . 我和TapKu以及Kal一起工作过。 Honestly, I recommend using Kal over TapKu, because Kal offers callback methods designed to work with loading data from the web. 老实说,我推荐使用Kal而不是TapKu,因为Kal提供了回调方法,用于处理来自网络的数据。 I can't say the same for TapKu. 我不能对TapKu说同样的话。

The TapKu documentation is here , but as you stated, there's no particular way to add data. TapKu文档在这里 ,但正如您所说,没有特别的方法来添加数据。 With TapKu, you basically specify which days to show marks on the calendar, and handle changes to the selected date. 使用TapKu,您基本上可以指定在日历上显示标记的日期,并处理所选日期的更改。

You can find more information about Kal at its Wiki on GitHub . 您可以在GitHub上找到有关Kal的更多信息。

You can use this delegate method : 您可以使用此委托方法:

-(NSArray *)calendarMonthView:(TKCalendarMonthView *)monthView marksFromDate:(NSDate *)startDate toDate:(NSDate *)lastDate
{
    // adds marks to the individual dates
    // return an array containing boolean values (YES/NO)
    // whether to mark the date[index];
}

I'm currently having no issue adding all my current events into the KAL calendar's data source, and changing the marker is very simple also. 我目前没有任何问题将所有当前事件添加到KAL日历的数据源中,并且更改标记也非常简单。 Although, it may be simple, some changes has to be done to the KAL.bundle file that you should have imported into your project/framework. 虽然可能很简单,但是必须对您应该导入项目/框架的KAL.bundle文件进行一些更改。 It contains all the photos used to create KAL's view. 它包含用于创建KAL视图的所有照片。

Anyways, you're going to want to go to KAL's directory and under KalTileView.m and it is there where you will find 无论如何,你会想要去KAL的目录并在KalTileView.m下,它就在那里你会发现

} else { 
textColor = ........
shadowColor = .......
markerImage = [UIImage imageNamed:@"Kal.bundle/kal_marker.png"];
}

The above code is in the drawRect method. 上面的代码在drawRect方法中。

Modifying the marker is fine.... but I found some difficulties importing several markers so I could randomly choose from the markers to display.... to make the app a little more colorful :P. 修改标记很好....但是我发现导入几个标记有些困难所以我可以从标记中随机选择显示....以使应用程序更加丰富多彩:P。 But nope, didn't work. 但不,不起作用。

Although, you can change the marker to another color if you'd like. 但是,如果您愿意,可以将标记更改为其他颜色。

http://developinginthedark.com/posts/iphone-tapku-calendar-markers http://developinginthedark.com/posts/iphone-tapku-calendar-markers

Go to this site to download the demo code, and also have the detail explanation of the method to add markers 转到此站点下载演示代码,并详细说明添加标记的方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM