UICollectionView not loading fully until I scroll

后端 未结 2 1688
耶瑟儿~
耶瑟儿~ 2021-01-21 05:36

I have a collection view that I want to display hourly weather in. I seem to have a problem with loading the cell, and for some reason scrolling forwards and then back loads the

相关标签:
2条回答
  • 2021-01-21 05:49

    I fixed the problem by adding cell.layoutIfNeeded() before the return cell. Everything loaded as expected without any scrolling!

    0 讨论(0)
  • 2021-01-21 06:05

    Seems like you populate your cells asynchronously, if so then add a mycollectionview.reloadData() at the end.

    0 讨论(0)
提交回复
热议问题