开发者

UIScrollView not detecting touches past the fold

开发者 https://www.devze.com 2023-02-05 07:06 出处:网络
I have a UIScrollView instance with many views inside.I have touchesBegan: defined inside my implementation of a subclass of UIView, but touches are only detected for views that are originally shown i

I have a UIScrollView instance with many views inside. I have touchesBegan: defined inside my implementation of a subclass of UIView, but touches are only detected for views that are originally shown inside the scrollview (without scrolling). That is, initially all touches are detected, but when I scroll down,开发者_如何学编程 no touches are detected, except for on those views which were originally above the fold (i.e. they originally fit in the scrollview), and moreover, only those parts of those views which were above the fold (in the cases of views that were partially shown originally).

I hope this is clear... anyone have any idea what could be causing a situation like this?


After a day of debugging, I found the simple solution. The height of the frame of the view inside the scrollview had been set to the height of the screen. I needed to extend it to the full height of the scrollview.

0

精彩评论

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