开发者

Picker in a ScrollView doesn't scroll

开发者 https://www.devze.com 2023-01-24 04:32 出处:网络
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

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 t开发者_开发知识库he TouchesMoved event.

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消