1
我想UICollectionView單元大小等於UICollectionView的寬度和高度。UICollectionViewCell大小等於UICollectionView大小
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
CGSize size=collectionView.bounds.size;
return CGSizeMake(414.0, 586.0);
}
如果我使用size
然後它引發自動佈局誤差the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
作爲高度是 650.0;它工作正常,如果我把高度設置爲586.0f
UICollectionView frame = (0 0; 414 650);
contentOffset: {0, 0}; contentSize: {0, 514}
那麼,我該如何解決這個高度問題?