We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// Constraint 타입 선언 private var collectionViewHeightConstraint: Constraint? imageCollectionView.snp.makeConstraints { $0.top.equalTo(imageTitleLabel.snp.bottom).offset(14) $0.leading.trailing.equalToSuperview().inset(12) collectionViewHeightConstraint = $0.height.equalTo(Size.UIScreenWidth / 3).constraint }
makeConstraints
questionTypeButton.backgroundButton.rx.tap .asSignal() .emit(with: self) { owner, _ in owner.dummyImage.append("Dummy") owner.imageCollectionView.reloadData() owner.collectionViewHeightConstraint?.update(offset: owner.imageCollectionView.collectionViewLayout.collectionViewContentSize.height) owner.view.layoutIfNeeded() } .disposed(by: disposeBag) func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return dummyImage.count }
CollectionView.collectionViewLayout.collectionViewContentSize.height
collectionViewContentSize
https://developer.apple.com/documentation/uikit/uicollectionviewlayout/1617796-collectionviewcontentsize
https://ios-development.tistory.com/867
The text was updated successfully, but these errors were encountered:
kimkyuchul
No branches or pull requests
SnapKit의 Constraint 의 프로퍼티를 생성하고, 버튼 탭 시 collectionView의 ContentSize 만큼 constraint.update하여 높이 레이아웃을 동적으로 변경
makeConstraints
안에서 .constraint로 획득 가능 (동시에 레이아웃도 적용)CollectionView.collectionViewLayout.collectionViewContentSize.height
를 활용한다.collectionViewContentSize
는 collectionView의 전체 높이와 너비를 반환한다.collectionViewContentSize
는 언제 할당되는가? -> https://insubkim.tistory.com/337https://developer.apple.com/documentation/uikit/uicollectionviewlayout/1617796-collectionviewcontentsize
https://ios-development.tistory.com/867
The text was updated successfully, but these errors were encountered: