【发布时间】:2017-11-30 18:01:59
【问题描述】:
我想让我的单元格具有不同的标题,但它始终显示相同的所有 我尝试使用二维数组但并不真正知道如何实现它
任何帮助将不胜感激,
class DequedCEll: UICollectionViewCell {
override init(frame: CGRect) {
super.init(frame: frame)
setupViews()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// this is the part where i stuck
let Mainlabel : UILabel = {
var label = UILabel()
label.text = "??"
label.font = UIFont.boldSystemFont(ofSize: 45)
return label
}()
func setupViews () {
backgroundColor = .yellow
addSubview(Mainlabel)
Mainlabel.anchorToTop(self.topAnchor, left: self.leftAnchor, bottom: self.bottomAnchor, right: self.rightAnchor)
}
}
【问题讨论】:
标签: ios uilabel uicollectionviewcell