iOS - Kal日历中的单选

时间:2014-10-22 11:47:45

标签: xcode ios8 kal

我面临kal calendar library的小问题,我不能使用单一选择,当我选择第二天选择一天时,我需要单一选择而没有偏移

这是问题

enter image description here

这是applicationDidFinishLaunching

中的代码
//#define Single
#ifdef Single
    kal = [[KalViewController alloc] initWithSelectionMode:KalSelectionModeSingle];
    kal.selectedDate = [NSDate dateStartOfDay:[[NSDate date] offsetDay:1]];
#else
    kal = [[KalViewController alloc] initWithSelectionMode:KalSelectionModeRange];
    kal.beginDate = [NSDate dateStartOfDay:[NSDate date]];
    kal.endDate = [NSDate dateStartOfDay:[[NSDate date] offsetDay:1]];
#endif

我的尝试

1-我将offsetDay:1设置为offsetDay:0,然后在KalSelectionModeSingle模式下将其删除 但它仍然是相同的

2-评论KalSelectionModeRange模式

   //kal = [[KalViewController alloc] initWithSelectionMode:KalSelectionModeRange];
   //kal.beginDate = [NSDate dateStartOfDay:[NSDate date]];
   //kal.endDate = [NSDate dateStartOfDay:[[NSDate date] offsetDay:1]];

我得到没有数据的白色窗口

任何帮助

谢谢

1 个答案:

答案 0 :(得分:0)

我认为答案只是让我的代码出来

//#define Single
#ifdef Single
    kal = [[KalViewController alloc] initWithSelectionMode:KalSelectionModeSingle];
    kal.selectedDate = [NSDate dateStartOfDay:[[NSDate date] offsetDay:1]];
#else
    kal = [[KalViewController alloc] initWithSelectionMode:KalSelectionModeRange];
    kal.beginDate = [NSDate dateStartOfDay:[NSDate date]];
    kal.endDate = [NSDate dateStartOfDay:[[NSDate date] offsetDay:1]];
#endif

 kal = [[KalViewController alloc] initWithSelectionMode:KalSelectionModeSingle];
    kal.selectedDate = [NSDate dateStartOfDay:[[NSDate date] offsetDay:1]];