Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Picker in a ScrollView doesn't scroll

I have a UIScrollView, inside it, a small UIView containing a UIPickerView. I'm able to scroll the view up and down but whenever I try to scroll the picker, it scrolls the view instead. I can change the picker's value by clicking it but not scrolling.

Any ideas?

EDIT: I just tried scrollView.canCancelContentTouches = NO; but it only works when I first Touch and then Drag, as in the TouchesBegan event. The scrollView still scrolls if I touch-move the Picker as in the TouchesMoved event.

What can I do to give my Picker its natural behavior in a ScrollView?

like image 839
Bernardo Oliveira Avatar asked Nov 08 '10 15:11

Bernardo Oliveira


1 Answers

You've already got canCancelContentTouches set to NO, but try setting delaysContentTouches to NO as well.

like image 165
John Calsbeek Avatar answered Nov 09 '22 17:11

John Calsbeek