https://www.cocoacontrols.com/controls/pmcalendar< - 我正在将此用于我的应用,我的问题是 选择日期后,我无法自动关闭视图。 帮我解决这个问题的朋友。这是我的代码,如果我使用[self.pmCC dismissCalendarAnimated:NO];表示日历视图甚至没有出现。
- (void)calendarController:(PMCalendarController *)calendarController didChangePeriod:(PMPeriod *)newPeriod
{
if(tfTemp==tfFromDate)
{
tfFromDate.text=[NSString stringWithFormat:@"%@ ", [newPeriod.startDate dateStringWithFormat:@"dd-MM-yyyy"]];
[Shareinfo sharedMySingleton].tripStartDate=newPeriod.startDate;
[self.pmCC dismissCalendarAnimated:NO];
}
} else
{
tfToDate.text=[NSString stringWithFormat:@"%@ ", [newPeriod.endDate dateStringWithFormat:@"dd-MM-yyyy"]];
[Shareinfo sharedMySingleton].tripEndDate=newPeriod.endDate;
[self.pmCC dismissCalendarAnimated:NO];
}
}
答案 0 :(得分:0)
它完美地工作后评论该线 [self calendarController:pmCC didChangePeriod:pmCC.period]; 在 - (void)showCalendar:(UITextField *)发件人