问题
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: Are there any open-source Launcher Views like the home screen?
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?!?
回答1:
You can use sections to group items and SupplementaryElements to decorate groups.
Or
You can also just create 2 kinds of different UICollectionViewCells: one normal cell + one group cell.
If your data source reflects grouping it should straight-forward to decide which one to return in collectionView:cellForItemAtIndexPath: .
来源:https://stackoverflow.com/questions/13519302/uicollectionview-like-ios-home-screen