UIView over UIScrollView prevents it from scrolling
I have UITableView
. Each cell has a view as shown below, a UIScrollView
in background and another view in UIScrollView.
The UIScrollView contains multiple images and the user should see them by scrolling to the right or left on the table cell. But since the second view ( red area ) covers the UIScrollview, the scrolling doesn't work when I swipe my finger in that area, but at the top of the red area, this is fine and works fine.
In another application that has this feature, I see that scrolling is possible at all heights of the cells, even if they have other views covering the background.
I would be grateful if you can share your suggestions with me :)
source to share
Save this line of code in the ViewDidLoad method:
[self.view setExclusiveTouch:YES];
And if that doesn't work, add it for your table view
[tableView setExclusiveTouch:YES];
Or else at the end, you can add a swipe gesture to the tableview cell and call the selector and do what should have been done.
source to share
The problem for me was that the view was not subordinate UIScrollView
. You can test this by setting a breakpoint somewhere in your class UIScrollView
or controller parent view and entering the following in the debugger window:
po myScrollView.subviews
Then check the output to make sure your item is in subzones.
source to share