UICollectionView Layout Issue

前端 未结 15 1665
天涯浪人
天涯浪人 2020-12-24 00:17

I am using UICollectionView using the flow layout. I have made a custom UICollectionViewCell for the same. But on running the project the console k

相关标签:
15条回答
  • 2020-12-24 01:14

    I just ran into the same error message, but for me the issue was that when I received new data from the api and tried to refresh my collectionView, the method that called [collectionView reloadData] wasn't calling it on the main thread.

    Hope this helps someone...

    0 讨论(0)
  • For me the solution was to set Estimate Size (in the storyboard size attributes pane) for the collection view to None.

    0 讨论(0)
  • 2020-12-24 01:17

    That fixed my problem:

    -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath 
    { 
    return CGSizeMake(self.collectionView.frame.size.width, self.collectionView.frame.size.height - 70);
    }
    

    U can see padding value from top and bottom on this screen:

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