0

I have a subview of a scrollView where there are some images. That images have the UILongPressGestureRecognizer property.

Opening the view, there are some images visibles and others that are not visibles. To show them, scroll is needed.

The problem is that GestureRecognizer action works well on visibles elements of the subview but not on elements that appear when user scroll. I verify that:

- (BOOL)gestureRecognizer:(UILongPressGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch

is called only when visible immages are touched, but not on the images hided by scroll.

User interaction are enable both on scroll and subview where elements are.

Any help will be appreciated.

doxsi
  • 1,002
  • 19
  • 42

1 Answers1

0

After some days, I solved the problem. In my case, when I adjust the height of the subview to the table, I was using the table frame size.

[mySubview setHeight:myTable.frame.size.height];

so the gesture recognize was hided from the dimension of the frame.

Changing with the content size

[mySubview setHeight:myTable.contentSize.height];

it works.

I hope it helps.

doxsi
  • 1,002
  • 19
  • 42