UIDatePicker in UIDatePickerModeCountDownTimer mode: how to change to minutes and seconds mode?

本秂侑毒 提交于 2019-12-10 09:22:56

问题


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?


回答1:


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's sample code UICatalog.app is for your reference. You can find there is a sample for how to create a customized picker.



来源:https://stackoverflow.com/questions/11501793/uidatepicker-in-uidatepickermodecountdowntimer-mode-how-to-change-to-minutes-an

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!