简体   繁体   English

UIDatePickerModeCountDownTimer模式下的UIDatePicker:如何更改为分钟和秒模式?

[英]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. 您必须在UIPickerViewDelegateUIPickerViewDataSource协议中实现一些方法。

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.

相关问题 UIDatePicker在UIDatePickerModeCountDownTimer模式下:如何通过代码获取/设置小时和分钟? - UIDatePicker in UIDatePickerModeCountDownTimer mode: how to get/set the hours and minutes via code? UIDatePicker UIDatePickerModeCountDownTimer模式无法选择零分钟 - UIDatePicker UIDatePickerModeCountDownTimer mode can't select zero minutes 在UIDatePickerModeCountDownTimer模式下,如何获取UIDatePicker的时间间隔? - How do you get the time interval for UIDatePicker in UIDatePickerModeCountDownTimer mode? 在UIDatePickerModeCountDownTimer模式下限制UIDatePicker的小时范围? - Limiting the hour range for UIDatePicker in UIDatePickerModeCountDownTimer mode? 在 UIDatePickerModeCountDownTimer 模式下 UIDatePickerView 的上限持续时间? - Cap duration of UIDatePickerView in mode UIDatePickerModeCountDownTimer? 如何在倒数模式下自定义UIDatePicker - How to customize a UIDatePicker in countdown mode UIDatePicker UIDatePickerModeCountDownTimer iPad图形Bug - UIDatePicker UIDatePickerModeCountDownTimer iPad Graphic Bug 更改日期选择器模式后如何重新加载UIDatePicker? - How to reload a UIDatePicker after changing the date picker mode? uidatepicker时间模式下如何添加元素? - uidatepicker time mode how i can add an element? 如何在UIDatePicker中将Minutes Component设置为0 - How to set Minutes Component to 0 in UIDatePicker
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM