简体   繁体   中英

UICollectionView for Grid Layout with Xamarin.iOS (MonoTouch)?

I was wondering if there is a UICollectionView implementation around for displaying views (images) in a grid as shown below.

I started to build it with UITableView, but it is getting really complicated if an item doesn't fit in the same row with its predecessor/successor.

样本网格

I came across this the other day, which is similar to what you want to do and may work out: http://pierceboggan.com/post/56951869926/pinterest-style-uicollectionviews-in-xamarin-ios

It is a modification of a UICollectionView made to work like the waterfall layout that Pinterest uses.

The default UICollectionViewFlowLayout, in horizontal mode, can do a lot of what you need, but it can't do the yellow cells, spanning multiple rows.

You could subclass the flow layout, and modify the layout attributes for each cell to have the correct position and size.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM