Questions tagged [uicollectionviewflowlayout]
209 questions
3
votes
1 answer
Crash UICollectionViewFlowLayout when applying snapshot on iOS 15
I have a UICollectionView with a simple UICollectionViewFlowLayout. On iOS 15 when first loading the view and setting the items an exception occurs.
This is called on the main thread when the items are set:
var snapshot =…

Marcel
- 6,393
- 1
- 30
- 44
3
votes
0 answers
Custom UICollectionViewFlowLayout crash for iOS 12
I wanted to create a table like layout (sort of Data tables) but the existing libraries did not provide custom buttons with actions associated to each rows(they only provided textual data in rows) so I created everything from scratch
I subclassed…

user121095
- 697
- 2
- 6
- 18
3
votes
0 answers
Pin section headers in eureka formviewcontroller
I have successfully pinned section headers in UICollectionView by setting sectionHeadersPinToVisibleBounds = true for UICollectionViewFlowLayout and subclassing UICollectionReusableView. Is it possible to do something similar when working with…

fonnes
- 509
- 1
- 3
- 13
3
votes
1 answer
Resizing UICollectionView cells with collectionView(_:layout:sizeForItemAt:) without calling reloadData()
I am trying to implement a UICollectionViewCell that includes a UITextView that resizes during runtime as the amount of text a user enters in it increases, as well as moves the cells above it up or down based on the size of the text box. (This…

smrk007
- 51
- 5
3
votes
1 answer
Section headers in UICollectionView, only first one appears
I have created a class for a section header and am loading it into my UICollectionView. I am able to display the first header (albeit oddly, see below), however any following section headers are blank. The size is being referenced, the content…

rantanplan
- 243
- 3
- 17
3
votes
1 answer
UICollectionView Self Sizing Cells
So I'm trying to figure out how to self size collection view cells. So I have a ViewController and I dragged a collectionView inside the ViewController. I am not using a xib file, I am using a prototype cell. Now I can't seem to figure out how to…

Luis F Ramirez
- 168
- 2
- 11
3
votes
2 answers
Change UICollectionView cell X position - swift
How can I change the X position of every single cell programmatically? I can change the width and height of the cell as my wish but it is unable to complete the project because of XY position.
My result ,
Expected result is,
and my full view…

Angel F Syrus
- 1,984
- 8
- 23
- 43
3
votes
2 answers
Unable to set width of UICollectionViewCell with AutoLayout
I have a Collection View with cells of dynamic height (based on a possibly multiline label and a textview inside), which adapts in height perfectly when I span it over multiple lines. However, when the text is just one word or it doesn't cover the…

PennyWise
- 595
- 2
- 12
- 37
3
votes
4 answers
Push viewController from CollectionView cell programmatically not working - swift
I am a new iOS programming. Now i am creating a sample app by not using storyboard which i implemented UICollectionView for the main class which scroll direction is vertical. A particular cell i added another UICollectionView for horizontal…

I Love Coding
- 580
- 5
- 13
3
votes
1 answer
Send message animation like iMessage send message using UICollectionView customization
I am working on chat application. I am using UIcollectionview for display message. I am trying to create animation on the send button. When the user taps on send UIButton at that I need animation like iMessage.
For creating such animation I use two…

Sanjaysinh Chauhan
- 201
- 1
- 7
2
votes
1 answer
Creating horizontal UICollectionView using UICollectionViewFlowLayout with ability to align cells to left and right simultaneously
I'm trying to create a horizontal UICollectionView with possibility to align part of cells to the left side and other part to the right. Between right and left cells should be empty space. Is it possible using UICollectionView and…

main_version_of_me
- 23
- 2
2
votes
1 answer
UICollectionView crash when moving items on iOS 16 beta
I have a UICollectionView in which user can long tap and then move the items. I have implemented func invalidationContext(forInteractivelyMovingItems and func invalidationContextForEndingInteractiveMovementOfItems methods to handle this.
While…

smartsanja
- 4,413
- 9
- 58
- 106
2
votes
0 answers
UICollectionViewCompositionalLayout two group in section
I use UICollectionViewCompositionalLayout to create UICollectionView, I want the first Item to occupy half the width, other Items to occupy 1/4 of the width, items grow downward, like this:
https://i.stack.imgur.com/uO5R9.png
but I can't achieve…

landev
- 21
- 1
2
votes
1 answer
UICollectionView Layout Wrong Item Size
I am programmatically creating a UICollectionViewController:
class MyCollectionVC: UICollectionViewController, UICollectionViewDelegateFlowLayout {
init() {
super.init(collectionViewLayout: UICollectionViewFlowLayout())
}
override…

Gizmodo
- 3,151
- 7
- 45
- 92
2
votes
1 answer
How can I center Buttons within UICollectionViewFlowLayout for two columns? Might there be a more efficient way to solve this?
I am implementing a menu, which holds severals buttons within two columns and I want the button text to be centered in the middle for every cell.
This is what it looks like right now:
This is my code for ViewController:
import SideMenu
import…

OuttaSpaceTime
- 710
- 10
- 24