spig
spig

Reputation: 1715

How do I scroll the iPhone UIPickerView from the last item to the first and continue forever?

I want my UIPickerView to rotate to the beginning of the list when it is scrolled past the bottom. How do I do this? Basically, I want the functionality of the UIDatePicker when it scrolls the hours/minutes/seconds continuously.

I'm assuming I could just return an extremely large number from the numberOfComponentsInPickerView and then the actual titleForRow with a modulus of the number, but I think there must be a better way. Plus, I'm not sure how it is handled when the wheel starts since I can't return a negative number and it doesn't normally scroll backwards.

Any thoughts on how to do this?

Upvotes: 1

Views: 1018

Answers (1)

spig
spig

Reputation: 1715

Maybe this idea would work - just keep the user in the middle of the wheel so it has the sensation of staying on the same wheel.

Upvotes: 1

Related Questions