0

我有一个 TKCalendarDayTimelineView 显示几个事件。当我点击一个事件时,它会触发 gotSingleTapAtPoint 方法。使用这种方法,我想在新视图中显示被点击的事件的详细信息。我该怎么做?有没有办法确定从选定点选择了什么事件?

- (void)tapDetectingView:(TapDetectingView *)view gotSingleTapAtPoint:(CGPoint)tapPoint
{
    //get the selected event, use the details to init a new view
    CGPoint pointInTimeLine = CGPointZero;
    pointInTimeLine = [view convertPoint:tapPoint toView:self.scrollView];
}
4

1 回答 1

0

您应该实现协议的可选calendarDayTimelineView:eventViewWasSelected方法TKCalendarDayTimelineViewDelegate。不要乱来tapDetectingView:gotSingleTapAtPoint

- (void)calendarDayTimelineView:(TKCalendarDayTimelineView*)calendarDayTimeline eventViewWasSelected:(TKCalendarDayEventView *)eventView 
{
   // Access the event that was tapped by "eventView.sourceEvent". Something like:
   EKEvent *event = eventView.sourceEvent;
   // Now use EKEventViewController to display the event
}
于 2012-10-24T16:11:07.367 回答