UICollectionview中的不同单元格大小 [英] Different cell size in UICollectionview

查看:114
本文介绍了UICollectionview中的不同单元格大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的iphone应用程序中,我在集合视图中显示图像。
我从网址获取图片,网址也是我的图片尺寸。
例如: - 假设有两种图像横向和纵向。我得到肖像图像的值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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆