开发者

UIScrollview : scroll with 2 fingers and not one

开发者 https://www.devze.com 2022-12-24 16:11 出处:网络
I have a UIScrollView containing another wiew. This view need to handle single touch event for drawing. For this reason I would like to scroll using 2 fingers.

I have a UIScrollView containing another wiew. This view need to handle single touch event for drawing. For this reason I would like to scroll using 2 fingers. I managed to get this working for 2.x SDK but it's no more working with 3.X series.

Do you have idea/workaround for achieving this?

Thanks in advance for your h开发者_运维问答elp :)


FWIW, I've tried exactly this as well on 3.x (never on 2.x) and never made it work correctly. It's possible that some combination of subclassing methods both approved (touchesShouldBegin...) and sketchy (touchesBegan..., hitTest...) could achieve this, but I've tried a lot of it, and could never get the event forwarding to work in a way that was consistent, and ended up with a parasitically fragile relationship to the scroll view.

I had to reimplement a scroll view from scratch to achieve this.

0

精彩评论

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

关注公众号