3

I have a UICollectionView that displays cells that can have multiple types of content. The content could be a view, a scrollview, a button, etc. For the most part, the table is displaying correctly, but touch events to not appear to be getting passed down to the cell contents. (Buttons aren't accepting clicks, scrollviews aren't scrolling).

Is there a way to pass the touch events to the contents on each cell?

cain
  • 1,028
  • 1
  • 12
  • 26

1 Answers1

0

Are you loading the UICollectionViewCell from nib? The elements in the nib are not added to the UICollectionViewCell's contentView and thus the events are not going through to cell contents.

I had the same problem wit a cell loaded from nib including a UITableView and I was able to fix it by manually adding the table to contentView like this:

[self.contentView addSubview:_tableView];

I found the fix here.

Community
  • 1
  • 1
lekksi
  • 4,868
  • 1
  • 16
  • 13