UIDatePicker valueChanged as wheels spin?

你离开我真会死。 提交于 2019-12-07 16:44:12

问题


I’m using a UIDatePicker to update UILabel with a date, but I’m noticing that the valueChanged event is only called when the wheels stop spinning.

Ideally if the user flicks a column, I’d like the date in the label to update continuously as the wheel spins, for a realtime sense of feedback.

Is this possible?


回答1:


This is an extreme workaround, but...

If you use a UIPickerView instead of a UIDatePicker (which, granted, would entail re-implementing most of the DatePicker), you can detect the wheel spinning in the pickerView:viewForRow:forComponent:reusingView: delegate method. If there are more rows than can be displayed at once, this will be called every time the wheel moves.



来源:https://stackoverflow.com/questions/27528398/uidatepicker-valuechanged-as-wheels-spin

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