在UIDatePickerModeCountDownTimer模式下限制UIDatePicker的小时范围? [英] Limiting the hour range for UIDatePicker in UIDatePickerModeCountDownTimer mode?

查看:695
本文介绍了在UIDatePickerModeCountDownTimer模式下限制UIDatePicker的小时范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将UIDatePicker中UIDatePickerModeCountDownTimer模式中显示的小时数范围从当前范围0 - 23限制为0-6。

I'd like to limit the range of the hours shown in the UIDatePicker in UIDatePickerModeCountDownTimer mode from the current range of 0 - 23 to 0-6.

是这可行还是我必须推出自己的UIPicker控件?

Is this feasible or do I have to roll out my own UIPicker control?

推荐答案

查看 UIDatePicker的 countDownDuration 属性。

我相信您可以设置倒计时的最大值。我推荐6 * 60 * 60(6小时* 60分钟* 60秒)。

I believe you can set the maximum value of the countdown there. I'd recommend 6 * 60 * 60 (six hours * sixty minutes * sixty seconds).

这篇关于在UIDatePickerModeCountDownTimer模式下限制UIDatePicker的小时范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆