UITableView inside UIScrollView not receiving first tap after scrollling

前端 未结 14 1843
北海茫月
北海茫月 2020-11-29 04:31

Brief

I am having an issue with a UITableView inside a UIScrollView. When I scroll the external scrollView, the table<

14条回答
  •  广开言路
    2020-11-29 05:07

    Gesture recognizers won't work correctly for two embedded scroll views or subclasses.

    Try a workaround:

    1. Use transparent, custom, and overlaying everything in cell UIButton with proper tag, or subclass UIButton and add a index path property and overwrite each time in reused cell.

    2. Add this button as a property to your custom cell.

    3. Add target for desired UIControlEvent (one or more) that points to your UITableViewDelegate protocol adopting class.

    4. Disable selecting in IB, and manually manage the selection from code.

    This solution requires attention for cases of single/multi selection.

提交回复
热议问题