UICollectionview 中的不同单元格大小 [英] Different cell size in UICollectionview
本文介绍了UICollectionview 中的不同单元格大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的 iphone 应用程序中,我在集合视图中显示图像.我从 url 获取图像,使用 url 我也得到图像大小.例如:- 假设有横向和纵向两种图像.纵向图像的值为 P,横向图像的值为 L
In my iphone app,I am showing images on a collection view. I fetch the images from urls,with urls I get the image size also. eg:- let's say there are two kinds of images landscape and portrait.I get value P for portrait images and L for landscape images
如何自定义collectionView单元格的大小?
How to customize the collectionView cell's size ?
推荐答案
使用这个UICollectionViewDelegateFlowLayout
方法
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
这篇关于UICollectionview 中的不同单元格大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文