自定義UICollectionViewCell出現(xiàn)崩潰:
reason: 'invalid nib registered for identifier (Cell) - nib must contain exactly one top level object which must be a UICollectionReusableView instance
因?yàn)镃ell的xib 文件,第一層只能一個(gè)東西。包括不能有手勢(shì)。需要給view添加點(diǎn)擊事件的話可以將UIView改成UIControl。UIControl可以關(guān)聯(lián)點(diǎn)擊事件。