Skip to content

Commit

Permalink
fix/#245 스크롤뷰 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
hooni0918 committed Jul 19, 2024
1 parent 4e0bb2e commit f469ffd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
15 changes: 10 additions & 5 deletions KkuMulKum/Source/Promise/ReadyStatus/View/ReadyStatusView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class ReadyStatusView: BaseView {
scrollView.addSubview(contentView)

addSubviews(scrollView)

}

override func setupAutoLayout() {
Expand All @@ -100,19 +101,23 @@ class ReadyStatusView: BaseView {
}

contentView.snp.makeConstraints {
$0.edges.width.equalToSuperview()
$0.height.greaterThanOrEqualToSuperview()
$0.edges.equalTo(scrollView.contentLayoutGuide)
$0.width.equalTo(scrollView.frameLayoutGuide)
}

baseStackView.snp.makeConstraints {
$0.top.equalToSuperview().offset(24)
$0.horizontalEdges.equalToSuperview().inset(20)
$0.leading.trailing.equalToSuperview().inset(20)
}

ourReadyStatusCollectionView.snp.makeConstraints {
$0.top.equalTo(baseStackView.snp.bottom).offset(22)
$0.horizontalEdges.equalToSuperview().inset(20)
$0.bottom.equalToSuperview().inset(20)
$0.leading.trailing.equalToSuperview().inset(20)
$0.height.equalTo(Screen.height(72) * 2)
}

contentView.snp.makeConstraints {
$0.bottom.equalTo(ourReadyStatusCollectionView.snp.bottom).offset(20)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ private extension ReadyStatusViewController {
readyStatusViewModel.participantInfos.bind(with: self) { owner, participants in
DispatchQueue.main.async {
owner.rootView.ourReadyStatusCollectionView.reloadData()

owner.rootView.ourReadyStatusCollectionView.snp.updateConstraints {
$0.height.equalTo(
CGFloat(participants.count) * Screen.height(72)
)
}
}
}

Expand Down

0 comments on commit f469ffd

Please sign in to comment.