UICollectionView 中不同单元格大小的自定义布局 [英] Custom layout for different cell sizes in UICollectionView

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

问题描述

我想使用新的 UICollectionView,但我不确定是否可以构建以下内容:

I would like to use the new UICollectionView, but I'm not sure if it is possible to build the following:

如您所见,有两种不同的细胞类型.一种是人像,一种是风景.当我使用流布局时,它总是创建与最高单元格一样高的单元格行.不是我需要的这种流畅"布局.

As you can see, there are two different cell types. One is portrait, one is landscape. When I use the flow layout, it always creates rows of cells which are as high as the tallest cell. Not this kind of "fluid" layout I need.

有没有可能用 UICollectionView 实现这种布局?

Is it possible at all to achieve this kind of layout with a UICollectionView?

以前有人做过这样的事情吗?有样品吗?我已经查看了许多教程和类参考...

Has anyone done something like this before? Are there any samples? I already checked out many tutorials and the Class References ...

谢谢!

推荐答案

你可以查看https://github.com/bryceredd/RFQuiltLayout .看起来你可以用这个

You can check out https://github.com/bryceredd/RFQuiltLayout . Looks like something you can use for this

这篇关于UICollectionView 中不同单元格大小的自定义布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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