开发者

Cap duration of UIDatePickerView in mode UIDatePickerModeCountDownTimer?

开发者 https://www.devze.com 2023-03-18 10:16 出处:网络
I need users to be able to select a duration, which it looks like UIDatePickerModeCountDownTimer is made for, but I want to cap it at, say, three hours, which it looks like it isn\'t.

I need users to be able to select a duration, which it looks like UIDatePickerModeCountDownTimer is made for, but I want to cap it at, say, three hours, which it looks like it isn't.

Can I do this with UIDatePicker, or would I be better off cr开发者_高级运维eating a custom two-column UIPickerView?


Hope this helps..

[pkrTime setMinuteInterval:3];

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"MM-dd-yyyy hh:mm:ss"];
NSDate *defaultDate = [dateFormatter dateFromString:@"01-01-2000 00:03:00"];
[dateFormatter release];

[pkrTime setMinimumDate:defaultDate];
0

精彩评论

暂无评论...
验证码 换一张
取 消