Questions tagged [uicollectionviewlayout]

The UICollectionViewLayout class is an abstract base class that is used to generate layout information for a collection view.

The UICollectionViewLayout class is an abstract base class that you subclass and use to generate layout information for a collection view. The job of a layout object is to determine the placement of cells, supplementary views, and decoration views inside the collection view’s bounds and to report that information to the collection view when asked. The collection view then applies the provided layout information to the corresponding views so that they can be presented onscreen.

More: UICollectionViewLayout Class Reference

1496 questions
0
votes
1 answer

Custom UICollectionViewLayout animation issues

I developed a custom UICollectionViewLayout to handle some advanced layout requirements on a clients application what seems to work really well.. Until I start trying to use animations. I took some time out of work to document and make it a bit more…
liamnichols
  • 12,419
  • 2
  • 43
  • 62
0
votes
1 answer

Pass additional context to Decoration View inside UICollectionViewLayout

I have an UICollectionView with a custom layout to display something similar to a Gantt chart. A decoration view is used to add a timeline across the top of the collection view. I need to pass along an NSDate to the decoration view for display…
chinabuffet
  • 5,278
  • 9
  • 40
  • 64
0
votes
1 answer

Artifact after changing uicollectionviewlayout

I'm switching between layouts in a uicollectionview using this code -(void)setHorizontalLayout:(BOOL)layout { if (layout == YES) { [self.collectionView performBatchUpdates:^{ [self.collectionView…
0
votes
1 answer

How to load UIImage to UICollectionView from an array of UIImage

So after saving UIImage to a NSMutableArray from ImagePickerController I want to load the images to UICollectionView, however the cells are not displaying anything even though the array isn't nil. -…
0
votes
2 answers

subclassing UICollectionViewFlowLayout

I am creating my own flowlayout but I am having problems getting the correct collectionViewContentSize, my data is an array of arrays, 5 arrays an each array have multiple items. Is this correct numberOfItemsInSection:0 ? or do i need check all…
HernandoZ
  • 742
  • 2
  • 12
  • 24
0
votes
1 answer

Can a UICollectionViewLayout have supplementary view in front of cell?

I'm aiming to have a static header with the cells passing underneath as the user scrolls. I've created the functionality I'm looking for, however if the supplementary views have a high zIndex than the cell, it blocks the didSelectItemAtIndexPath:…
Benjamin
  • 663
  • 8
  • 23
0
votes
1 answer

Why does insetForSectionAtIndex not affect top and bottom inset?

I have a UICollectionView, using the basic flow layout. I've implemented the insetForSectionAtIndex method, returning a UIEdgeInsets with top and bottom insets, as well as the left and right: - (UIEdgeInsets)collectionView:(UICollectionView…
Steven
  • 1,049
  • 2
  • 14
  • 32
0
votes
1 answer

UICollectionView Custom Layout With A Single Cell In View

I'm trying to make an application that only has one row of cells in a UICollectionView, however I'm using the FlowLayout and that stacks cells as seen below. I want to make it something like this. Where the user can swipe left or right to get to…
0
votes
1 answer

Create UICollectionView programmatically

I'm trying to teach myself how to use a UICollectionView by building it programatically. I have followed some tutorials to create a sample collection view of size 500 x 500, with each cell being 245 x 45. Thus far, I am able to see the collection…
0
votes
0 answers

-[UIViewAnimationContext completionHandler]: message sent to deallocated instance

I am having a major trouble while I am trying to drag a UICollectionViewCell far away to trigger deletion. The way I do is hide the cell on long press, copy the cell contents to a new UIView which moves around with the finger. It works except when…
0
votes
1 answer

UICollectionViewFlowLayout implementation

I am trying to accomplish the following, I've done this easily with UIScrollview but I've been experimenting with UICollectionView lately (I know I'm pretty late to the game) and would love to know if in order to do what I want I have to implement a…
MrShoot
  • 843
  • 1
  • 9
  • 21
0
votes
1 answer

UICollectionViewLayout. Where are all my items?

When I implement UICollectionView without a custom layout object, all 16 of my reusable cells appear. That is, I have 1 section with 16 items in that section. When I create a custom layout object, only 1 cell appears. If I change # of sections to…
DanMoore
  • 621
  • 1
  • 8
  • 14
0
votes
1 answer

UICollectionViewFlowLayout's layoutAttributesForItemAtIndexPath returns nil when called "too early"

My setup: A standard UICollectionView with a flow layout; datasource is set to my controller. The layout is configured as usual in the xib file. When I try to access a cell's layout attributes via layoutAttributesForItemAtIndexPath: in the…
jasamer
  • 1,089
  • 1
  • 10
  • 18
0
votes
3 answers

How to pass parameters using @selector

I need to pass parameters with @selector and here is the method that i need to call using selector: -(void)clickedInfo:(NSString *)itemIndex{ // some work with itemIndex } I know that what i can do is to use an intermediate method as described…
0
votes
1 answer

UICollectionViewLayout for potentially millions of items

So I have a UICollectionView using a custom layout. I use prepareLayout to set up the attributes, but now my dataset has grown and pulls the info from a database & there are potentially millions of items - obviously I can't store the attributes for…
SomaMan
  • 4,127
  • 1
  • 34
  • 45