UICollectionView就像iOS Home Screen一样 [英] UICollectionView like iOS Home Screen

查看:194
本文介绍了UICollectionView就像iOS Home Screen一样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个像iOS Home Screen一样的UICollectionView。我找到了几个(和好的)样本,如:

I wanna make an UICollectionView like iOS Home Screen. I found several (and good) samples like:

http://mobile.tutsplus.com/tutorials/iphone/uicollectionview-layouts/

http://www.cocoacontrols.com/platforms/ios/controls/sespringboard

http://www.cocoacontrols.com/platforms / ios / controls / aqgridview

http://www.cocoacontrols.com/platforms/ios/controls/namenu

http://www.cocoacontrols.com/platforms/ios/controls/mgbox2

iOS:是否有像主屏幕那样的开源Launcher视图?

以上所有库都运行良好。编辑,删除和动画不是问题。但是将两个单元组合成一个新组,好吧,没有一个库可以做到。我搜查了很多,但没有找到任何东西。
有没有人知道任何库可以通过拖放来组合两个单元格?!?!
或至少有一些如何制作的提示?!

All libraries above work well. Editing, removing and animating is not a problem. But combining two cells into a new group, well, none of the libraries was able to do it. I heavily searched and I didn't find anything. Does anybody know any libraries to combine two cells with drag and drop?!?! Or at least has some tips on how to make?!?

推荐答案

您可以使用部分对项目进行分组用于装饰组的补充元素。

You can use sections to group items and SupplementaryElements to decorate groups.

您还可以创建2种不同的UICollectionViewCells:一个普通单元格+一个组单元格。

You can also just create 2 kinds of different UICollectionViewCells: one normal cell + one group cell.

如果你的数据源反映了分组,它应该直接决定在collectionView中返回哪一个:cellForItemAtIndexPath:。

If your data source reflects grouping it should straight-forward to decide which one to return in collectionView:cellForItemAtIndexPath: .

这篇关于UICollectionView就像iOS Home Screen一样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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