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
0 answers

UICollectionViewLayout with large number of network images and aspect ratio

Unlike a data source object which provides data on-demand, the UICollectionView Layout is a delegate that layout the whole collection view once. (calling sizeForItemAtIndexPath for all items). My question is, if I have a collection view of 100…
Andy
  • 31
  • 3
0
votes
1 answer

When is it safe to check the contentView.size of a UICollectionViewCell with variable size

Hello there stackoverflowers, I have a collection view with a custom flow layout. My cells can have different sizes which are calculated by: - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath Then, in…
0
votes
1 answer

Customizing / subclassing UICollectionViewLayout to enable scrolling in multiple directions

I'm designing a layout for my app that is going to take advantage of UICollectionView. I have created some moderately complex collectionView-based apps before, but I may need to subclass the layout class for this one. The main point I'm trying to…
SaltyNuts
  • 5,068
  • 8
  • 48
  • 80
0
votes
1 answer

Simple way to stagger cells in UICollectionView

I am working on an iOS app that has a UICollectionView. I would like to make a simple custom layout in which the middle cell on each row is slightly lower than the one on the right and left. I've been looking over tutorials and the apple…
Ben
  • 967
  • 3
  • 9
  • 23
0
votes
1 answer

Decrease Space between UICollectionViewCells

Objective I am trying to decrease the space between my UICollectionViewCells What I tried I tried subclassing UICollectionViewFlowLayout and overriding this method: - (NSArray *) layoutAttributesForElementsInRect:(CGRect)rect { NSArray *answer =…
0
votes
1 answer

UICollectionView not redrawing cells when inserted at position where cells were deleted before

I am making a UICollectionView control which would look like (fig-1) : I have added the ability to delete cell by swiping the cells to right. My problem case - If I delete the last cell by swiping (fig-2) , which will call the following code. -…
0
votes
1 answer

Clear header and White background for UICollectionView

I have been looking all over the web for this issue, but I have not been able to find anything helpful. Any help or direction will be highly appreciated. I have a UICollectionView with a header (that contains simple text/title) and then a grid. What…
0
votes
1 answer

UICollectionViewCell spacing

I have a UICollectionView that fits 3 cells on width (and scrolls vertically). When I change the rotation of the device, the collection view stretches a little bit, and the cells spacing increases a little too. Yet, the left cell snaps to the left…
0
votes
0 answers

Stack to Grid UIcollectionView with dynamically changing number of sections

I am using two subclasses of UICollectionViewController, StackViewController and GridViewController. I am using a stack type gallery at first and then the transition happens when pinching any cell. In the stack I have 5 albums so I passed…
0
votes
0 answers

Guard Malloc Crash with UICollectionView

On iOS 7, I have two viewControllers that my app switches between using a Navigation Controller. The 2nd VC contains a UICollectionView and I've subclassed UICollectionViewCell. When I turn OFF Guard Malloc my app successfully executes the following…
Nick
  • 628
  • 6
  • 21
0
votes
1 answer

Issues laying UICollectionView to create 2x3 grid iOS

I am attempting to lay my UICollectionView out such that it is a 2x3 grid per page. Here is what I am getting so far: As you can see, the next "page" is peeping in from the right, which I don't want. I figured if I know my width is always going to…
0
votes
2 answers

iOS7 UICollectionViewCell not being reused when dequeuing cell

the method -(void)prepareForReuse In my collection view cell is never called - leading me to suspect that the UICollectionView is not dequeuing cells properly. This is causing lagyness and memory issues. I've set up my collectionView as…
Avba
  • 14,822
  • 20
  • 92
  • 192
0
votes
1 answer

how to redraw views inside a collectionview cell after switching to a different flow layout?

I got my collectionview of photos to change layout with the following code: newLayout = [[SDCGalleryLayout alloc] init]; and then [self.collectionView setCollectionViewLayout:newLayout animated:YES]; It works fine and it animates from one…
0
votes
0 answers

UICollectionViewCell rotation

I have a collection view, that no matter what device there are 4, equally sized cells that fit in an area on the screen. That area is the device height-20-50-3/2. 20 is the status bar, 50 is a cancel button and 3 is 1px line at top, between the cell…
0
votes
1 answer

Can I have contentSize specific to a section in UICollectionView with my custom Layout

I have a section which is scrollable horizontally with paging and other sections normal with vertical scrolling enabled in UICollectionView. Now the thing is UICollectionViewLayout has contentSize property which is defined for whole…
user1010819
  • 2,691
  • 3
  • 15
  • 14