使用分页在UICollectionView中重新加载单元格导致下一个单元格加载

时间:2019-03-28 23:17:46

标签: ios swift uicollectionview swift4 swift4.2

在调用时:self.collectionView.reloadItems(at:[centerCellIndexPath])我想在indexPath处重新加载单元格,但是它也在重新加载下一个单元格。为了获得进一步的背景信息,我正在使用运动事件(抖动)来完成此操作,但是我不认为这是问题的一部分。

barButtonVar.isEnabled = false

目的是在indexPath的collectionView单元中更改一个// Shake Gesture Recognizers for Player Change override func motionBegan(_ motion: UIEvent.EventSubtype, with event: UIEvent?) { // Disable Scroll On Shake Completion self.collectionView.isScrollEnabled = false if let centerCellIndexPath: IndexPath = collectionView.centerCellIndexPath { self.collectionView.reloadItems(at: [centerCellIndexPath]) latestIndexPath = centerCellIndexPath.row print("Shake on card: \(centerCellIndexPath)") } // Play the sound for each card SoundManager.playSound(.cowbell) } ,此方法有效。不利地,下一个单元格及其UILabel也被更改。

enter image description here

0 个答案:

没有答案