cocoa-touch - 确定 UIPickerWheel 是否正在滚动

标签 cocoa-touch ios uikit uipickerview

嘿,有什么方法可以确定 UIPickerView 当前是否正在滚动,我的应用程序确实需要该功能,这非常重要。谢谢!

最佳答案

有一个技巧可以检测到这一点,但是没有委托(delegate)方法/属性来检测它是否在滚动

  1. 取一个属性为isScrolling
  2. func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? 或等效方法中将 isScrolling 设置为 true
  3. func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) 中将 isScrolling 设置为 false

关于cocoa-touch - 确定 UIPickerWheel 是否正在滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5304839/

相关文章:

ios - UITableView indexPathForSelectedRow 在 iOS 中总是返回 0

ios - 子类化 UIPageViewController,但是当我将 [[alloc] init] 的结果分配给自己时,我收到警告。为什么?

iphone - 从 XCODE 中使用 SVN 的 BLAME 命令

ios - 什么时候应该使用 UIImageJPEGRepresentation 和 UIImagePNGRepresentation 将不同的图像格式上传到服务器?

python - 如何使用 uikit 将导航栏固定在顶部?

iphone - 创建类似于所选 UITableViewCell 的 UILabel 背景

ios - 可以将应用程序从后台带到前台吗?

ios - SpriteKit 粒子发射器改变颜色

ios - 在 MKMapView 上绘制自定义形状(地理围栏)区域

objective-c - 如何调试由 UIKit 的 CoreAnimation 调用触发的崩溃?