【发布时间】:2019-07-11 00:05:50
【问题描述】:
UICollectionView 标头部分。
class HeaderView: UICollectionReusableView {
@IBOutlet weak var lbl_HeaderText: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
}
设置标题的值。
func collectionView(_ collectionView: UICollectionView,
viewForSupplementaryElementOfKind kind: String,
at indexPath: IndexPath) -> UICollectionReusableView {
let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "HeaderView", for: indexPath)
headerView.lbl_HeaderText = "Some Text"
return headerView
}
}
lbl_HeaderText 不显示子类链接到 headerView 链接仅指向 UICollectionReusableView 不显示或具有“HeaderView”属性
【问题讨论】:
标签: ios uicollectionview uicollectionreusableview