美文网首页
viewForSupplementaryElementOfKin

viewForSupplementaryElementOfKin

作者: 一念飘过 | 来源:发表于2018-08-23 11:44 被阅读0次

在使用collectionView的时候发现这个代理方法不走了。

func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView

看网上说是需要实现这个方法:

厚爱

加上去还是不走。

然后再自定义布局上加上了:

layout.headerReferenceSize = CGSize(width: screenWidth, height: 50)

就可以了。

相关文章

网友评论

      本文标题:viewForSupplementaryElementOfKin

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