UIDatePickerModeCountDownTimer模式下的UIDatePicker:如何更改为分钟和秒模式? [英] UIDatePicker in UIDatePickerModeCountDownTimer mode: how to change to minutes and seconds mode?

查看:46
本文介绍了UIDatePickerModeCountDownTimer模式下的UIDatePicker:如何更改为分钟和秒模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在情节提要中添加了UIDatePicker,并将模式设置为CountDownTimer.它仅显示小时和分钟,但是我需要的是分钟和秒模式.我不需要小时列,而需要分钟和秒列.我尝试更改时间间隔,但最小值为1分钟.是否可以?我怎样才能做到这一点?

I added UIDatePicker in my storyboard, and set mode to 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. Is it possible? How can I do this?

推荐答案

您可以为分钟选择器创建数据源.它具有两个组成部分:分钟和秒.您必须在 UIPickerViewDelegate UIPickerViewDataSource 协议中实现一些方法.

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.

Apple的示例代码

Apple's sample code UICatalog.app is for your reference. You can find there is a sample for how to create a customized picker.

这篇关于UIDatePickerModeCountDownTimer模式下的UIDatePicker:如何更改为分钟和秒模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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