Search code examples
iosswiftuikituicollectionviewcellcollectionview

How I can delete this space between tabbar and collectionView?


How I can delete this space between tabbar and collectionView? I have a tabbar -> viewcontroller -> collection this purple rect it is part of ViewController, but the problem that collection view has the same frame as vc.

enter image description here

Here log:

print("Frame.height:  collectionView ->\(collectionView.frame.height) ---  view \(view.frame.height)")

Terminal

  Frame.height:  collectionView -> 812.0 ---  view 625.0

Solution

  • Are you changing the height of the standard tabbar?

    If so, you're doing it in the wrong place, and the ViewController might compute its height before your change on the tabbar. Try modifying the height in viewWillLayoutSubviews.