1
我目前正在研究应用程序,其中我需要UICollectionview的动态单元大小类似于hooked story app
。 如何创建UICollectioview Cell动态大小像上瘾的应用程序
上图中展示我need.I与其他自定义库,如 试图WaterfallCollectionView
,MosaicLayout
,FMMosaicLayout
,greedo-layout
使用的CollectionView委托方法
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
return [self sizeForPhotoAtIndexPath:indexPath];
}
-(CGSize)sizeForPhotoAtIndexPath:(NSIndexPath *)indexPath
{
UIImage *image = [imageArray objectAtIndex:indexPath.row];
return CGSizeMake(image.size.width, image.size.height);
}
但我的照片,从API负载,我无法预测图像加载之前该单元格的大小。 所以请帮助我这个。谢谢你提前。
我真的不看到你的形象实际上是在你的代码 – MNM
检查现在,我添加的代码图像 –
你正在从服务器我想不会从那里加载图像,大概这取决于'imageViews'模式'看点配合'等等。 – vaibhav