-1

In the app I am doing, I have a fullscreen collection view with paging and I want the status bar to be displayed on top of the collection view (the status bar background being transparent so that the battery level and other texts are drawn on top of what's under the status bar, ie the collection view) but I end up having a black background for the status bar and a weird animation when I scroll, changing the height of my cells to take the status bar height into consideration...

scrolled down a bit

releasing so it will align the page

page is aligned

How can I disable this effect so that my collection view pages scroll under the status bar with no effect?

Thank you!

Sarah
  • 1
  • 1
  • 1
    This is not an example of a good question. You must provide example code of previous attempts, to illustrate what you have tried. You must show your current output, as well as your desired output, and give a more detailed account of your problem, and the ideal solution. See [How to Ask a Good Question on Stack Overflow](https://stackoverflow.com/help/how-to-ask) – cmprogram Oct 16 '18 at 15:02
  • I do believe you are looking for [this] (https://stackoverflow.com/questions/31399166/set-image-underlay-of-transparent-navigation-bar-and-status-bar-in-swift-ios-8) – Savca Marin Oct 16 '18 at 15:08
  • @SavcaMarin I tried these... but it doesn't work ;'( my main issue is that iOS in some way resizes my cells at the moment the page aligns to the top of the screen below the status bar... I can easily see my cell being scaled down. I have no issue to set the status bar background transparent – Sarah Oct 16 '18 at 15:25

1 Answers1

0

Ok, that's what I found out: - this behaviour is handled by the collectionView itself - in xcode/interfacebuilder, there is a checkbox "Insets To Safe Area" that is only available for UITableView and not UICollectionView - I switched to a tableView instead and this symptom disappeared

it now behaves as expected!

Thank you!

Sarah
  • 1
  • 1