0
나는 하나의 컨트롤러에 3 collectionViews
을 가지고 있습니다. 각 collectionView
의 모든 것은 한 가지를 제외하고는 완벽하게 설정되어 있습니다. 둘 이상의 섹션을 설정하면 항상 한 섹션이 반환됩니다!UICollectionView는 하나의 섹션 만 반환합니까?
func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
switch collectionView {
case oneCollectionView:
return 1
case twoCollectionView:
return 3
case threeCollectionView:
return 5
default:
return 10
}
}
난에있어 어떤 부분에 따라 개별적으로 항목의 수를 설정하고 사용자 정의
backgroundColors
을 제공하더라도
.
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
switch collectionView {
case oneCollectionView:
return 25
case twoCollectionView:
return 10
case threeCollectionView:
switch section {
case 0:
return 200
case 1:
return 300
case 2:
return 5
default:
return 1
}
default:
return 1
}
}
을 그리고이 모든 collectionView입니다! 나는 머리글을 추가하는 것이 효과가있을 것이라고 생각했으나 아무런 결과도 발생하지 않았다. colectionViews의 모든 섹션에 1 개의 섹션 만 표시되는 이유가 있을까요?