I have a UIScrollView with UIImageView, UILabels and below a UICollectionView, i have disabled the scrolling of the collection view because i want that all the view scroll with that UIScrollView, i get the data to display in a WebServer so the number of items in the CollectionView can change at every request, to calculate the height of the UICollectionView, and then i add that value to the content size of the UIScrollView so i can scroll all the collection view, all this implementations works, the problem is that in this way the UICollectionView load all cell before display the CollectionView because the frame of the CollectionView is bigger than the screen display, so my question is how i can achieve the normal lazy loading of the UICollectionViewCell?
1 Answers
0
votes
The right answer here is to not do what you're doing, because that is simply how UICollectionViews are populated. You have 2 options for a correct solution to this, without an extra UIScrollView.
1) Build the views above your UICollectionView into it as supplementary elements.
2) Add those views as static subviews to your UICollectionView and adjust its contentInset so that the actual content does not overlap with your static views.
Using either of these methods, you avoid having nested scrollviews and just have your single collection view.