4 ms·
> "Complex" Layouts" > Neither Android or iOS support this "Flow Layout" natively I don't know about Android, but iOS has just that : UICollectionViewFlowLayo
by thomasjoulin 13y ago
> "Complex" Layouts"
> Neither Android or iOS support this "Flow Layout" natively
I don't know about Android, but iOS has just that : UICollectionViewFlowLayout. It would be trivial to implement a tag list as he did.
- aa0 13y agoWas just about to post this. Also, IB is great and constraints are easy to manage once you realize that it's a calculated ruleset that enforces unambiguous constraints. The iOS framework is beautiful, and the author favored Android mostly due to his inexperience with both platforms.
- robmcm 13y agoIs that therefore a failing in the apple documentation, or perhaps not meeting the conventions with other frameworks and languages out there?
- rimantas 13y agoThere is no failing in documentation. The framework is the same (UIKit), and in fact the API is a lot like that for UITableViewController—the cornerstone of many iOS apps.
- cageface 13y agoAutoLayout in IB in Xcode 4 was an absolute nightmare. Easily one of my most frustrating dev tool experiences ever. It's much better in Xcode 5.
- jcampbell1 13y agoA UICollection view is complex solution compared to the CSS equivalent of "float:left", or "display:inline-block". Furthermore, you will be responsible for resizing the collection view and its sibling views or getting auto-layout working correctly to do part of this for you. In the tag layout, it would be about as easy to just write line-wrapping code by hand, than to use a UICollectionView.
- pat2man 13y ago> In the tag layout, it would be about as easy to just write line-wrapping code by hand, than to use a UICollectionView. Possibly but the code you would be writing for UICollectionView would be mostly boiler plate. All the layout would be handled for you. Updating a few parameters would be quite easy and you could do it via IB or via code. Once you wrote this once it would also be quite portable.
- jcampbell1 13y ago> All the layout would be handled for you. No it won't. The tags are variable width, you have to implement something like sizeForItemAtIndexPath. You also must monitor the height of scrollable content region, so you have to monkey patch the collectionViewContent size (or KVO a non-public property), so you can resize the collection view and have the outer controller layout the subviews. Collection Views don't really make sense when the collection view shouldn't scroll.