0
나는 iCarousel의 뷰에서 가운데에 놓고 싶은 세 개의 UI 요소를 서로 위에 놓았습니다 (하나의 버튼과 두 개의 텍스트 레이블). 나는 이런 식으로 NSLayoutContraits를 사용해 보았다.iCarousel에서 cellview의 요소를 가운데에 배치하는 방법은 무엇입니까?
[self.backgroundView addConstraint:[NSLayoutConstraint constraintWithItem:self.descriptionLabel
attribute:NSLayoutAttributeCenterX
relatedBy:NSLayoutRelationEqual
toItem:self.backgroundView
attribute:NSLayoutAttributeCenterX
multiplier:1
constant:0]];
[self.backgroundView addConstraint:[NSLayoutConstraint constraintWithItem:self.descriptionLabel
attribute:NSLayoutAttributeCenterY
relatedBy:NSLayoutRelationEqual
toItem:self.backgroundView
attribute:NSLayoutAttributeCenterY
multiplier:1
constant:0]];
그러나 작동하지 않는다. 어떤 아이디어?