uicollectionview

Populating UICollectionView in reverse order

。_饼干妹妹 提交于 2019-12-20 23:22:14
问题 I would like to populate UICollectionView in reverse order so that the last item of the UICollectionView fills first and then the second last and so on. Actually I'm applying animation and items are showing up one by one. Therefore, I want the last item to show up first. 回答1: I'm assuming you are using UICollectionViewFlawLayout, and this doesn't have logic to do that, it only works in a TOP-LEFT BOTTOM-RIGHT order. To do that you have to build your own layout, which you can do creating a new

Continuous vertical scrolling between UICollectionView nested in UIScrollView

丶灬走出姿态 提交于 2019-12-20 18:45:09
问题 While I know nested scrollViews aren't ideal, our designers provided me with this setup, so I'm doing my best to make it work. Let's begin! View Hierarchy UIView UIScrollView (Vertical Scrolling Only) UIImageView UICollectionView #1 (Horizontal Scrolling Only) UIImageView (different from previous UIImageView) UICollectionView #2 (Vertical Scrolling Only) Important Note All my views are defined using programmatic Auto Layout. Each successive view in the UIScrollView's subview hierarchy has a y

UICollectionView with autosizing cells incorrectly positions supplementary view

ⅰ亾dé卋堺 提交于 2019-12-20 18:42:31
问题 I am using a UICollectionView with a Flow Layout and trying to get the collectionView to size the cells appropriately according to AutoLayout constraints. While the cells work as intended, I am running in to issues with the layout of any supplementary views that I add to the CollectionView. Specifically, the supplementaryView will be in the wrong position (i.e., the y origin is incorrect) on initial layout, before 'correcting' itself after I scroll. For reference, here is how I am configuring

UICollectionView with autosizing cells incorrectly positions supplementary view

落花浮王杯 提交于 2019-12-20 18:42:11
问题 I am using a UICollectionView with a Flow Layout and trying to get the collectionView to size the cells appropriately according to AutoLayout constraints. While the cells work as intended, I am running in to issues with the layout of any supplementary views that I add to the CollectionView. Specifically, the supplementaryView will be in the wrong position (i.e., the y origin is incorrect) on initial layout, before 'correcting' itself after I scroll. For reference, here is how I am configuring

UICollectionView with autosizing cells incorrectly positions supplementary view

大城市里の小女人 提交于 2019-12-20 18:42:11
问题 I am using a UICollectionView with a Flow Layout and trying to get the collectionView to size the cells appropriately according to AutoLayout constraints. While the cells work as intended, I am running in to issues with the layout of any supplementary views that I add to the CollectionView. Specifically, the supplementaryView will be in the wrong position (i.e., the y origin is incorrect) on initial layout, before 'correcting' itself after I scroll. For reference, here is how I am configuring

UICollectionView in a UICollectionViewCell

若如初见. 提交于 2019-12-20 18:09:10
问题 I am interested in having a collectionview as a part of a collection view cell but for some reason cannot figure out how this would be done. Where would I implement the necessary methods for the cells collectionview? 回答1: There's an article that Ash Furrow wrote that explains how to put an UICollectionView inside an UITableViewCell . It's basically the same idea when using it inside an UICollectionViewCell . 回答2: Everything is done programatically. No storyboards. I added a UICollectionView

UICollectionView doesn't bounce when datasource has only 1 item

半城伤御伤魂 提交于 2019-12-20 17:32:56
问题 I have a UICollectionView with a custom UICollectionViewFlowLayout. It scrolls horizontally and only shows one item at a time (full height). I have pagingEnabled = YES so that it sticks to pages. The UICollectionView shows photos within a particular day. I initially had buttons to change the day +/- 1 day, but I thought it would be neat if the user could pull on the collection view past the first or last image (past a predetermined threshold) to change the day. I implemented this using the

How to remove the margin between two UICollectionView columns

谁说我不能喝 提交于 2019-12-20 17:27:11
问题 I have UICollectionView in which I would like to have no spacing between the cells. However despite my all effort I can't seem to remove the the space, Code - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section { return 0; } - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:

UICollectionView cellForItemAtIndexPath not registering cell

▼魔方 西西 提交于 2019-12-20 16:22:27
问题 I am trying to use UICollectionViewCell , since all I want to display is an image. I can add the image to the cell using UIColor colorWithImage: on the UICollectionViewCell 's contentView property. In my loadView method, I am registering the cell as follows: [self.collectionView registerClass:[ImageCell class] forCellWithReuseIdentifier:@"MyCell"]; Below is my cellForItemAtIndexPath method: - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:

UICollectionView cellForItemAtIndexPath not registering cell

末鹿安然 提交于 2019-12-20 16:21:35
问题 I am trying to use UICollectionViewCell , since all I want to display is an image. I can add the image to the cell using UIColor colorWithImage: on the UICollectionViewCell 's contentView property. In my loadView method, I am registering the cell as follows: [self.collectionView registerClass:[ImageCell class] forCellWithReuseIdentifier:@"MyCell"]; Below is my cellForItemAtIndexPath method: - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath: