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

UICollectionViewCell two columns without gap

I have this code -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { if(indexPath.row==0) { return CGSizeMake(320, 143.5); } …
0
votes
1 answer

Is possible to have two UICollectionViewLayout for a single UICollectionView?

Is is possible to use two UICollectionViewLayout in a UICollectionView and use the desired UICollectionViewLayout and load them based on the indexpath.item?
m177312
  • 1,199
  • 2
  • 14
  • 22
0
votes
0 answers

UICollectionView (UIScrollView) Not responding when scrolling

I've found a rather odd problem with my UICollectionView implementation in that when scrolling at a reasonable velocity releasing touch, and then while it is scrolling attempting to stop the scrolling doesn't work (By touching down). Looking at my…
0
votes
1 answer

How to set up a horizontal UICollectionViewFlowLayout without line breaks

Currently I have a standard UICollectionViewFlowLayout scrolling horizontally, but it stack items onto each other, if the height allows. Instead I want to have a collection view that scrolls horizontally and does no line breaking, i.e. does not…
Reinhard Männer
  • 14,022
  • 5
  • 54
  • 116
0
votes
1 answer

How to have one cell by column in a UICollectionView?

In the same vein as in this question, I would like to have a UICollectionView with horizontal scrolling and with only one item (cell) per column. How can I do that?
Colas
  • 3,473
  • 4
  • 29
  • 68
0
votes
2 answers

UICollectionView scroll horizontal with data flowing from left to right

I saw a somewhat similar problem here: Reorder cells of UICollectionView. However, the solution involves overriding UICollectionViewFlowLayout to reorder the cells. But in my case, I don't want to reorder the cells, but simply transform the…
RedRoses
  • 327
  • 3
  • 15
0
votes
0 answers

Custom collection view layout leaves dirty screenshot of cell on selection

I am pretty new to implement a custom collection view layout. The layout contains cells with size of screen's width and height, like a photo gallery view. But when I select a cell the didSelectItemAtIndexPath:(NSIndexPath *)indexPath method runs…
Ali Ersöz
  • 15,860
  • 11
  • 50
  • 64
0
votes
1 answer

UICollectionView with zero interItemSpacing

I'm trying to subclass the UICollectionViewFlowLayout so that I can eliminate the space in between cells, because the flow layout only allows you to set a minimumInterItemSpacing, and not a maximumInterItemSpacing. I need a collectionView that…
0
votes
1 answer

UICollectionViewFlowLayout and ios6

I have an Extended UICollectionFlowLayout. This vertically centres the UIcollectionViewCell by translating the attribute.frame by required amount and also shifting the visible Rect of collection view to show the transformed cells. This works…
ila
  • 920
  • 12
  • 35
0
votes
1 answer

UICollectionView with pagingEnabled - get content to stop at top

The collection view has a frame of 320x400, and the cells have a size of 320x320. The collection view scrolls vertically with pagingEnabled = YES. So at any time you can see one cell and part of another cell below. When you scroll up, I need each…
0
votes
1 answer

How to reorder UICollectionView cells while locks some of them

I am reordering UICollectionView cells while locking few items. when i reorder unlocked items, the locked items also get rearranged. How can i shuffle array.? or i have to modify layout attributes for Elements ? -…
0
votes
1 answer

Custom CollectionView layout - message was sent to deallocated NSDictionary

I'm having trouble switching between two subclassed CollectionViewFlowLayouts. I call the following method in my collectionViewController: header: @property (nonatomic, strong) PortraitFlowLayout *portraitFlowLayout; @property (nonatomic, strong)…
Chris
  • 7,830
  • 6
  • 38
  • 72
0
votes
0 answers

UICollectionViewCell size issue

I'm experiencing a layout issue with my collectionView. I've set the cell sizes to be different for the first cell (indexPath.row == 0) but then the same afterwards. - (CGSize)collectionView:(UICollectionView *)collectionView…
0
votes
1 answer

UICollectionViewFlowLayout with fixed item width

How can I tell my UICollectionViewFlowLayout custom subclass to use a static, fixed item width value? I would like my delegate to implement a custom method: collectionView:layout:heightForItemAtIndexPath: to return a variable item height, while the…
akashivskyy
  • 44,342
  • 16
  • 106
  • 116
0
votes
2 answers

Using 2 UICollectionView instances but cells aren't showing in one of them

Goal: Set up two collectionViews with different styles. One grid style and other single file style. These collectionViews will be toggleable giving users shopping within the ability to view the items for sale in which ever style (grid/single file)…
LondonGuy
  • 10,778
  • 11
  • 79
  • 151