我面临kal calendar library的小问题,我不能使用单一选择,当我选择第二天选择一天时,我需要单一选择而没有偏移
这是问题
这是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]];
我得到没有数据的白色窗口
任何帮助
谢谢
答案 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]];