美文网首页
nib must contain exactly one top

nib must contain exactly one top

作者: 木_穆 | 来源:发表于2019-04-18 15:57 被阅读0次

    自定义UICollectionViewCell出现崩溃:

    reason: 'invalid nib registered for identifier (Cell) - nib must contain exactly one top level object which must be a UICollectionReusableView instance

    因为Cell的xib 文件,第一层只能一个东西。包括不能有手势。需要给view添加点击事件的话可以将UIView改成UIControl。UIControl可以关联点击事件。

    相关文章

      网友评论

          本文标题:nib must contain exactly one top

          本文链接:https://www.haomeiwen.com/subject/lrjtgqtx.html