Reputation: 25244
i've got a tableview. inside this, i have a tableviewcell with a horizontal scrollview inside it.
it works fine, but if i start scrolling horizontal inside a tableviewcell and move a bit up or down, the horizontal scrolling stops and the tableview gets scrolled.
is there a way to prevent the tableview from scrolling while scrolling horizontal inside a tableviewcell?
thanks for all help
Upvotes: 1
Views: 1424
Reputation: 31722
you should not put the UIScrollView
inside an UITableView
. you could show the content of your cell vertically Or show on the details view
UITableView
is a subclass of UIScrollView
.
Form Apple Documentation.
Important: You should not embed UIWebView or UITableView objects in UIScrollView objects. If you do so, unexpected behavior can result because touch events for the two objects can be mixed up and wrongly handled.
Upvotes: 1
Reputation: 16022
try scrollView.canCancelContentTouches = NO
If that doesn't work you may have to do more complicated handling of touch events by subclassing UIScrollView. (Look at touchesBegan:event:, touchesMoved:event:, touchesEnded:event:, touchesCancelled:event:
)
Upvotes: 3