iOS UICollectionView prototype cell size property ignored

后端 未结 9 1952
花落未央
花落未央 2021-01-30 19:51

I\'m using a UICollectionView with two prototype cells. The prototype cells have different widths and contain different controls (image view and web view). I\'m definitely ret

9条回答
  •  花落未央
    2021-01-30 20:17

    Use its Default Delegate . . .

    - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
    {
        CGSize mElementSize;
        mElementSize = CGSizeMake(SCREEN_WIDTH , SCREEN_HEIGHT *0.60);
        return mElementSize;
    }   
    

提交回复
热议问题