UITableView inside UIScrollView not receiving first tap after scrollling

前端 未结 14 1800
北海茫月
北海茫月 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:05

    It seems that your UiTableView doesn't recognize your tap. Did you try to use that :

    - (BOOL)gestureRecognizer:(UIPanGestureRecognizer *)gestureRecognizer
    shouldRecognizeSimultaneouslyWithGestureRecognizer:(UISwipeGestureRecognizer             *)otherGestureRecognizer
    {
        if ([otherGestureRecognizer.view isKindOfClass:[UITableView class]]) {
            return YES;
        }
        return NO;
    }
    

    Note from apple:

    called when the recognition of one of gestureRecognizer or otherGestureRecognizer would be blocked by the other. return YES to allow both to recognize simultaneously. the default implementation returns NO (by default no two gestures can be recognized simultaneously)

    note: returning YES is guaranteed to allow simultaneous recognition. returning NO is not guaranteed to prevent simultaneous recognition, as the other gesture's delegate may return YES

    Hope that will help.

提交回复
热议问题