从UIPickerView获取连续数据?

时间:2013-10-14 10:21:22

标签: ios uipickerview

如何利用当前正在旋转的UIPickerView的瞬时值? (UISlider有一个"连续"模式,但UIPickerView没有。)

任何解决方法的想法?或者我错过了什么?

3 个答案:

答案 0 :(得分:0)

UIPickerView的委托只允许你选择一个:

– pickerView:didSelectRow:inComponent:

当选择器旋转时,您将不会收到事件,例如滚动时可以在UIScrollView中获得的事件。

我担心没有直接的方法来获取它

答案 1 :(得分:0)

要从$totalUsers = count_users(); $batchSize = 1000; $batchesCount = ceil($totalUsers['total_users'] / $batchSize); $Users = array(); for ($count = 0; $count < $batchesCount; $count++) { $args = array( 'number' => $batchSize, 'offset' => $count * $batchSize, ); $batchNewUsers = get_users($args); $Users = array_merge($Users, $batchNewUsers); } 获取连续数据,您只需启动计时器并调用选择器的UIPickerView功能。

像这样......

selectedRow(inComponent:)

答案 2 :(得分:0)

这可以通过CADisplayLink

实现
@property (nonatomic, strong) CADisplayLink *displayLink;

self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(handleDisplayLink:)];
[self.displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:UITrackingRunLoopMode];

- (void) handleDisplayLink:(CADisplayLink *) displayLink
{
    NSLog(@"%s %ld", __func__, [self selectedRowInComponent:0]);
}