내가 collectionview cell
나는 프로그래밍 방식
class CollectionViewCell: UICollectionViewCell {
@IBOutlet weak var label: UILabel!
override func layoutSubviews() {
super.layoutSubviews()
constraint()
}
func constraint() {
label.addConstraint(NSLayoutConstraint(item:label, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: 25))
}
}
의 레이블 설치 높이 제한에 노력하고 collectionview 셀에 위의 라벨 제약의 높이를 않았다 설정과 작동하지 않습니다. 여기서 layoutSubviews
선언이 작동합니까? 이 레이아웃에 영향을 미치지 않는 경우에도
collectionview를 사용하고 있는데 "콘센트가 반복되는 콘텐트에 연결될 수 없다"고했기 때문에 할 수 없습니다. – leaner122
@ leaner122, 레이블은 CollectionViewCell에 있으므로 바인딩은 CollectionviewCell CLASS의 속성과 CollectionviewCell의 Label 제약 사이에 있어야합니다 XIB 또는 Stroryborad. –