UICollectionView didSelectItemAtIndexPath not called when tapped on UITextView

前端 未结 6 1517
傲寒
傲寒 2021-02-13 05:13

I have a UICollectionView with custom cells- They have a UITextView that mostly covers the entire cell. This presents a problem when using didSel

6条回答
  •  囚心锁ツ
    2021-02-13 06:00

    I ran into this problem when I had a scroll view taking up my entire collection view cell. While all the solutions above probably work fine, I came up with my own elegant work-around. I put a 'select' label under my scroll view. Since the label is not part of the scroll view, it passes the tap event on to the collection view. It also serves as a nice indicator that an action is required of the user.

提交回复
热议问题