简体   繁体   中英

UICollectionView navigation bar flashes

I have this weird behavior with my UICollectionview where, briefly during the initial load, the navigation bar expands into the view and then disappears.

  1. The collection view has been added to the view and the first cell added. The first cell is always this static "New Game" button.
  2. The collection view is working on adding in the other elements. These are loaded from local storage, and a cell is added for each game that is found.
  3. Between adding the "new game" cell and pulling in the game cells, the navigation bar shows up.

Any ideas what could be going on here? Happy to share more information; just let me know what is relevant!

As per our discussion in the comments, you are hiding the navigation bar in viewDidAppear .

self.navigationController?.isNavigationBarHidden = true

You should instead hide the navigation bar before the view appears, in viewWillAppear .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM