UICollectionView reloadData not functioning properly in iOS 7

問題:

I've been updating my apps to run on iOS 7 which is going smoothly for the most part.我一直在更新我的應用程序以在 iOS 7 上運行,這在大多數情況下進展順利。 I have noticed in more than one app that the reloadData method of a UICollectionViewController isn't acting quite how it used to.我在不止一個應用程序中注意到UICollectionViewControllerreloadData方法UICollectionViewController那樣起作用。

I'll load the UICollectionViewController , populate the UICollectionView with some data as normal.我將加載UICollectionViewController ,像UICollectionView用一些數據填充UICollectionView This works great on the first time.這在第一次很有效。 However if I request new data (populate the UICollectionViewDataSource ), and then call reloadData , it will query the data source for numberOfItemsInSection and numberOfSectionsInCollectionView , but it doesn't seem to call cellForItemAtIndexPath the proper number of times.但是,如果我請求新數據(填充UICollectionViewDataSource ),然後調用reloadData ,它將查詢numberOfItemsInSectionnumberOfSectionsInCollectionView的數據源,但它似乎沒有調用cellForItemAtIndexPath正確的次數。

If I change the code to only reload one section, then it will function properly.如果我將代碼更改爲僅重新加載一個部分,那麼它將正常運行。 This is no problem for me to change these, but I don't think I should have to.改變這些對我來說沒有問題,但我認爲我不應該這樣做。 reloadData should reload all visible cells according to the documentation. reloadData應根據文檔重新加載所有可見單元格。

Has anyone else seen this?有沒有其他人看到這個?


解決方案:

參考: https://stackoom.com/en/question/1Grvf
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章