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

Animating a UICollectionViewCell: Scroll To And Resize At The Same Time

I'm trying to get a UICollectionViewCell to do an animated resize and at the same time have the collection view scroll the cell to the top of the collection view's viewport. When I do - (void)collectionView:(UICollectionView *)collectionView…
0
votes
2 answers

UICollectionView embed in a UINavigationController,but the UICollectionViewCell frame is wrong

I have a UINavigationController to control two ViewControllers,VC1 and VC2. The pic shows is VC2. And there has a UICollectionView as a VC2.view's subview,also there has a UICollectionCell embed in UICollectionView ,as you can see below. But When I…
0
votes
1 answer

UICollectionViewFlowLayout subclass: sticky cell disappearing after reloadData

I have the following subclass of UICollectionViewFlowLayout: @implementation MyFlowLayout - (instancetype)init { self = [super init]; self.stickyIndexPaths = [NSMutableArray array]; return self; } -…
SaldaVonSchwartz
  • 3,769
  • 2
  • 41
  • 78
0
votes
2 answers

CollectionView grid with images. Images don't fit in the grid

I'm trying to create a Grid layout that shows some pictures. Now I'm using a FlowLayout and I create my CollectionView like this: - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath…
user1007522
  • 7,858
  • 17
  • 69
  • 113
0
votes
1 answer

UICollectionViewLayoutAttributes custom derived class instance is not created

I have created this class public class CustomLayoutAttributes: UICollectionViewLayoutAttributes { public float PhotoHeight { get; set; } public override NSObject Copy (NSZone zone) { CustomLayoutAttributes…
George Taskos
  • 8,324
  • 18
  • 82
  • 147
0
votes
1 answer

UICollectionView: Waterfall layout with Drag & Drop

I am using CHTCollectionViewWaterfallLayout as the layout for my collectionView, since my cells do all have different sizes. But I would also like to implement drag & drop in my collectionView. The libraries I have found would not allow me to…
0
votes
0 answers

UICollectionView With Next and Previous Buttons

I have an UICollectionView with X-Number of Cells, and i have two buttons one left side an right side, I have written a logic for next and previous buttons, when I tap on next button two cells are coming instead of one. -…
Harish
  • 2,496
  • 4
  • 24
  • 48
0
votes
1 answer

Why UICollectionView with UICollectionViewFlowLayout not show cells, but ask for size?

Why collectionview with flow layout sometimes not showing cells, but delegate ask for size, and section items count and responder give correct information. Here example, trouble with 6 section 2015-04-08 04:43:59.020 ASKED SECTION:0…
0
votes
1 answer

How to manually use estimatedSize from FlowLayout

In iOS 8 we got a opportunity to create autosize cells with property flowlayout called estimated Size. But in my case i want use this opportunity manually. but can't understand how? In method of delegate sizeForItemAtIndexPath i can't call…
0
votes
1 answer

prevent the uicollectionview cell form moving to the right when there is space -- SWIFT

my problem is that the uicollectionview cell is moving to left when the next cell jumps to the second line and there is space in the first line (space which didnt fit to contain the next cell), how could i prevent the cell from moving to the right,…
0
votes
1 answer

UICollectionView Cell dynamic height

I have created an UICollectionView cell and it's displaying perfectly, but my doubt is have given an constant size of cell in sizeForItemAtIndexPath. My issue is each and every cell is containing dynamic height, how can i calculate and give at…
Harish
  • 2,496
  • 4
  • 24
  • 48
0
votes
0 answers

Stop custom collection view section at needed position

I have a problem with shifting section of my collection view. I am using this CSStickyHeaderFlowLayout So as I see all calculation is here: - (void)updateHeaderAttributes:(UICollectionViewLayoutAttributes *)attributes…
Matrosov Oleksandr
  • 25,505
  • 44
  • 151
  • 277
0
votes
2 answers

Collection View vertical padding issue

I am making a collection view which is horizontally scrolled. The collection view is in a uitableview cell My height of collection view is 170 I am making a cell of 75x75 -(UIEdgeInsets)collectionView:(UICollectionView *)collectionView…
0
votes
1 answer

How to center a cell with the content offset in a UICollectionView with scrollToItemAtIndexPath

I am implementing a UICollectionView which shows only a single line of cells. It is like an image cover flow. This means I have subclassed UICollectionViewFlowLayout. My implementation works fine when I use my finger for scrolling, meaning that the…
darbid
  • 2,545
  • 23
  • 55
0
votes
3 answers

How can you determine spacing between items in UICollectionView?

I have a colors collectionView like this: But the space between rows in my collection view is too big. I try to set minimumInteritemSpacing, minimumLineSpacing, sectionInset and try some way in stackoverflow but none of them are worked. Can anyone…
Bad_Developer
  • 537
  • 5
  • 20