uicollectionviewcell

UICollectionView flowLayout not wrapping cells correctly

雨燕双飞 提交于 2019-11-26 04:32:20
问题 I have a UICollectionView with a FLowLayout. It will work as I expect most of the time, but every now and then one of the cells does not wrap properly. For example, the the cell that should be on in the first \"column\" of the third row if actually trailing in the second row and there is just an empty space where it should be (see diagram below). All you can see of this rouge cell is the left hand side (the rest is cut off) and the place it should be is empty. This does not happen

How to set cell spacing and UICollectionView - UICollectionViewFlowLayout size ratio?

时光总嘲笑我的痴心妄想 提交于 2019-11-26 04:04:00
问题 I\'m trying to add UICollectionView to ViewController , and I need to have 3 cells \'per row\' without blank space between cells (it should look like a grid). Cell width should be one third of screen size, so I thought that the layout.item width should be the same. But then I get this: If I reduce that size (by 7 or 8 pixels e.g.), it\'s better, but the third cell in row is not completely visible, and I still have that blank space (top & bottom, and left & right) . class ViewController:

Autoresizing issue of UICollectionViewCell contentView's frame in Storyboard prototype cell (Xcode 6, iOS 8 SDK) happens when running on iOS 7 only

我的未来我决定 提交于 2019-11-26 02:39:57
问题 I\'m using Xcode 6 Beta 3, iOS 8 SDK. Build Target iOS 7.0 using Swift. Please refer to my problem step by step with screenshots below. I have a UICollectionView in Storyboard. 1 Prototype UICollectionViewCell which contains 1 label in the centre (no autoresizing rule). Purple background was to mark a contentView that is generated in runtime by the Cell I guess. That view will be resized properly base on my UICollectionViewLayoutDelegate eventually, but not on iOS 7. Notice that I\'m using

UICollectionView Self Sizing Cells with Auto Layout

孤人 提交于 2019-11-26 01:25:28
问题 I\'m trying to get self sizing UICollectionViewCells working with Auto Layout, but I can\'t seem to get the cells to size themselves to the content. I\'m having trouble understanding how the cell\'s size is updated from the contents of what\'s inside the cell\'s contentView. Here\'s the setup I\'ve tried: Custom UICollectionViewCell with a UITextView in its contentView. Scrolling for the UITextView is disabled. The contentView\'s horizontal constraint is: \"H:|[_textView(320)]\", i.e. the