UIPickerView,检测“滚轮"开始和停止? [英] UIPickerView, detect "rolling wheel" start and stop?
问题描述
我刚刚发现,如果执行以下操作:
- 单击将
UIPickerView
动画化到我的视图中的按钮 - 快速启动滚轮,然后滚过最后一个项目
- 使用按钮关闭视图
然后它还没有选择最后一个项目.
我尝试通过在每次触发didSelectRow
方法时将其简单地输出到控制台,并在滚轮稳定在最后一项上时触发该方法来进行尝试.
我是否可以检测到车轮仍在滚动,以便可以延迟检查选定的值直到其稳定下来?
如果有问题,我正在使用MonoTouch进行编程,但是如果您有一个代码示例,那么我可以很好地阅读Objective-C代码以重新实现它.
我认为您可以检查UIPickerView是否处于动画制作中并等待其停止.在链接
I just discovered that if I do the following:
- Click the button that animates a
UIPickerView
into my view - Quickly start the wheel rolling towards, then past, the last item
- Dismiss the view with a button
Then it has not yet selected the last item yet.
I tried this by simply outputting to the console whenever the didSelectRow
method was fired, and it fires when the wheel stabilizes on the last item.
Can I detect that the wheel is still rolling, so that I can delay checking it for a selected value until it stabilizes?
If it matters, I'm programming in MonoTouch, but I can read Objective-C code well enough to reimplement it, if you have a code example that is.
I think you can just check if the UIPickerView is in the middle of animating and wait for it to stop. This was answered here link
这篇关于UIPickerView,检测“滚轮"开始和停止?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!