开发者

prevent tableview from scrolling while scrolling inside a tableviewcell

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 tableview开发者_如何学Gocell 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


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:)


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.

More

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜