0

I have a ViewController with 3 views :

  • Header (UIView)
  • TabBar (UIView)
  • UIView3 (UIView)

In my UIView3 I have a collectionViewController. A key element is that I put my collectionViewController.scrollEnable = False because otherwhise, when I'm scrolling, only the UIView3 is scrolling and I want my entier screen to scroll (so that if we scroll enough my Header and Tabbar are hidden.

So this is what I have :

enter image description here

And this is how my screen looks like :

enter image description here

Which is perfect. But, when I'm scrolling down, this is what it should looks like :

enter image description here

But instead, it looks like this :

enter image description here

I think my problem comes from the "dequeueReusableCellWithReuseIdentifier" function which doesn't see that I'm scrolling but I have no idea how to "refresh" the scroll value so it loads the end of cells 3-4 and also the cells 5-6.

Do you have any idea ?

user3369214
  • 421
  • 1
  • 9
  • 21
  • Can you paste some code?? – Tapas Pal Aug 07 '15 at 07:03
  • @TapasPal Which part do you want ? My code is pretty large but I know that everything works separately. The UICollectionView controller works perfectly when its not in a UIView. – user3369214 Aug 07 '15 at 07:17
  • Your problem is not in dequeueReusableCellWithReuseIdentifier. Height of UIView3 or collection view is wrong. Try adding a different color border to both of them (.layer.border* - quartz core) so you see their bounds when you scroll up. – Swapnil Luktuke Aug 07 '15 at 07:27
  • Also, your approach seems too convoluted. Why not use a simple collection view controller and make a large custom section header view with your view1 and tab bar? – Swapnil Luktuke Aug 07 '15 at 07:28
  • @lukya Well, the UiView3 height looks fine and the collectionView controller also because, even though it doen't load the collectionView, the UIView3 update its height exactly the height it should have (so I can scroll a white screen the same size it should have if the collectionView was loading) and I do UIView3.height = UIcollectionView.contentSize.height so I think this is not the problem – user3369214 Aug 07 '15 at 07:40
  • @lukya Because I tried before with a custom section header view but it didn't work the way I wanted – user3369214 Aug 07 '15 at 07:41
  • 1
    Not just the contentSize, you do also update Collection View's height along with UIView 3 right? – Swapnil Luktuke Aug 07 '15 at 07:44
  • @lukya That solved my problem ! I was only updating my collectionView contentSize and not my contentViewHeight... You are a genius ! <3 Now, I have only one more problem, all the cells that are not shown before the scroll cannot be selectable (but the others (the first two) are)... – user3369214 Aug 07 '15 at 08:44

0 Answers0