我正在使用这个类,https://github.com/TimCinel/ActionSheetPicker在我的应用程序中选择当前日期。问题是我还想用这样的选择器选择一个时间(小时和分钟)。任何人都可以帮我定制课程或知道任何其他可以做到这一点的课程吗?谢谢!
问问题
207 次
1 回答
2
没用过,现在才看到源代码。但从这里:
_actionSheetPicker = [[ActionSheetDatePicker alloc] initWithTitle:@"" datePickerMode:UIDatePickerModeDate selectedDate:self.selectedDate target:self action:@selector(dateWasSelected:element:) origin:sender];
您需要定义您的datePickerMode:UIDatePickerModeDate
,因此您需要检查UIDatePickerMode
接受的类型。所以:
typedef enum {
UIDatePickerModeTime, // Displays hour, minute, and optionally AM/PM designation depending on the locale setting (e.g. 6 | 53 | PM)
UIDatePickerModeDate, // Displays month, day, and year depending on the locale setting (e.g. November | 15 | 2007)
UIDatePickerModeDateAndTime, // Displays date, hour, minute, and optionally AM/PM designation depending on the locale setting (e.g. Wed Nov 15 | 6 | 53 | PM)
UIDatePickerModeCountDownTimer // Displays hour and minute (e.g. 1 | 53)
} UIDatePickerMode;
选择你想要的。
于 2012-07-09T07:19:40.747 回答