Jos*_*eph 5 tableview uicollectionview uicollectionviewcell swift4 ios15
这是我第二次在这里发布有关此问题的文章,没有人可以帮助我当我在模拟器或具有 iOS 15 的真实设备上调试我的应用程序时,我的项目在 iOS 14 和以前的版本中运行良好,collectionView 在滚动时或直到 collectionView 消失从看到的消失,当collectionViews消失时,这会在调试器中显示我
myPorjectiOS[21684:5460574] [Assert] UITableView internal inconsistency: cell prefetched for IP(3,0) already stored for IP(3,0). Cell: <myPorjectiOS.DashboardSectionTwoTableItem: 0x136307200; baseClass = UITableViewCell; frame = (0 149; 375 150); autoresize = W; layer = <CALayer: 0x28064e7c0>>; Prefetched Cells: {
"<NSIndexPath: 0xa51756da222d5115> {length = 2, path = 3 - 0}" = "<myPorjectiOS.DashboardSectionTwoTableItem: 0x136307200; baseClass = UITableViewCell; frame = (0 149; 375 150); autoresize = W; layer = <CALayer: 0x28064e7c0>>";
t] UITableView internal inconsistency: cell already prefetched for IP(3,0). Existing: <myPorjectiOS.DashboardSectionTwoTableItem: 0x136307200; baseClass = UITableViewCell; frame = (0 149; 375 150); autoresize = W; layer = <CALayer: 0x28064e7c0>>; New: <myPorjectiOS.DashboardSectionTwoTableItem: 0x136307200; baseClass = UITableViewCell; frame = (0 149; 375 150); autoresize = W; layer = <CALayer: 0x28064e7c0>>; Prefetched Cells: {
"<NSIndexPath: 0xa51756da222d5115> {length = 2, path = 3 - 0}" = "<myPorjectiOS.DashboardSectionTwoTableItem: 0x136307200; baseClass = UITableViewCell; frame = (0 149; 375 150); autoresize = W; layer = <CALayer: 0x28064e7c0>>";
Run Code Online (Sandbox Code Playgroud)
这仅在 iOS 15 中运行应用程序时显示
项目单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: R.reuseIdentifier.dashboardSectionTwoCollectionItem.identifier, for: indexPath) as? DashboardSectionTwoCollectionItem
let object = self.object[indexPath.row]
cell?.bind(object)
//fixing the hiding CollectionViews
return cell!
}
Run Code Online (Sandbox Code Playgroud)
self.collectionView.reloadData()
我尝试在它解决我的问题之前添加return cell!
,但视图很滞后,我无法点击我的内容
这是我的setupUI
func setupUI(){
self.collectionView.delegate = self
self.collectionView.dataSource = self
collectionView.register(UINib(resource: R.nib.dashboardSectionTwoCollectionItem), forCellWithReuseIdentifier: R.reuseIdentifier.dashboardSectionTwoCollectionItem.identifier)
}
func bind(_ object:[GenresModel.Datum]){
self.object = object
self.collectionView.reloadData()
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
468 次 |
最近记录: |