Pass UICollectionView touch event to its parent UITableViewCell

前端 未结 5 1698
温柔的废话
温柔的废话 2020-12-09 20:30

Here is the view structure:

The outer view is a UITableView.

Inside the UITableViewCell, there is a UICollectionView

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-09 21:02

    Is that possible to set collectionView's backgroundView UserInteraction not enable, but make sure the collectionViewCell did, so that it could pass the tapEvent to next responder.

    - (void)viewDidLoad {
        theCollectionView.userInteractionEnabled = NO;
    }
    

    I hope it would help.

提交回复
热议问题