[英]UIDatePicker in UIDatePickerModeCountDownTimer mode: how to change to minutes and seconds mode?
I added UIDatePicker in my storyboard, and set mode to CountDownTimer. 我在情节提要中添加了UIDatePicker,并将模式设置为CountDownTimer。 It shows hours and minutes only, but what i need is minutes and seconds mode.
它仅显示小时和分钟,但我需要的是分钟和秒模式。 I don't need hour column, need minute and seconds columns.
我不需要小时列,不需要分钟和秒列。 I try to change interval, but it's minimum value is 1 minute.
我尝试更改间隔,但最小值为1分钟。 Is it possible?
可能吗? How can I do this?
我怎样才能做到这一点?
You can create a datasource for you minute-seconds picker. 您可以为分钟选择器创建数据源。 It has two Components: minute and seconds.
它有两个组成部分:分钟和秒。 You have to implement some methods in
UIPickerViewDelegate
and UIPickerViewDataSource
Protocols. 您必须在
UIPickerViewDelegate
和UIPickerViewDataSource
协议中实现一些方法。
Apple's sample code UICatalog.app is for your reference. Apple的示例代码UICatalog.app供您参考。 You can find there is a sample for how to create a customized picker.
您可以找到有关如何创建自定义选择器的示例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.