Questions tagged uicollectionviewcell

Explore the latest questions and answers asked by our top developers.

Self Sizing CollectionView cell not work properly after reload data

I am creating a collectionView that can have multiple sections with a self-sizing cell. it works nicely on the initial layout. but after reload, I encounter three problem Scrolling become choppy cell size changed and cell overlap with each other content offset changed after reload data here is ViewController code class ViewController: UIViewController { @IBOutlet […]

UICollectionViewCell – animate cell height change when its content changes

I have a really simple UICollectionView, using iOS 13’s UICollectionViewCompositionalLayout. The cells have a vertical UIStackView, and when you press the “toggle details” button, I simple change the isHidden value of the detailsView. When the cells then inform the view controller that it needs to execute collectionView.collectionViewLayout.invalidateLayout(), everything basically works: the details view is toggled […]

By Kevin Renskers
Categorised as ios, uicollectionview, uicollectionviewcell

UICollectionViewCell With 2 column grid and dynamic height

I’m trying to have collection view with 2 column but dynamic height. I have used Autolayout and given required constraints to the Cell By this way I can calculate the dynamic height but its column grids fails. func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: “Cell”, […]

By Nitesh
Categorised as ios, swift, uicollectionview, uicollectionviewcell

dynamic collectionView in TableView

I have a dynamic collectionView in TableView and there are three errors: the cells are not displayed correctly when the application starts when I do inserItem the cells flicker as if they are rebooting and most importantly when collectionView.insertItems the first four cells are hidden, the video thanks MainViewController class ViewController: UIViewController, UIScrollViewDelegate { override […]

By Vasya2014
Categorised as ios, swift, uicollectionview, uicollectionviewcell, uitableview

Create dynamic collectionView inside tableview cell

I’m trying to create a horizontal collection view inside a tableviewcell, with a dynamic size uiimageview inside, which will be the mandatory view. I created a UIView : public class CardImage: UIView { private var imageView: UIImageView? private var titleLabel: UILabel? private var descriptionLabel: UILabel? private var subtitleLabel: UILabel? private var icon: UIImage? private var […]

UICollectionView Doesn’t Respond Until Scrolling Completely Stops

I have a standard, working uicollectionview and my issue is when I scroll vertically, the uicollectionview doesn’t respond to any subsequent touch (i.e. stop scroll) until after the scroll comes to a complete halt. I was able to pin the issue down to the willDisplayCell delegate method where I’m animating each displaying cell with a […]

By Chris
Categorised as cgaffinetransform, ios, swift, uicollectionview, uicollectionviewcell

align single UICollectionViewCell to the left of the collectionView

I’ve got a collectionView that is inside a tableView cell. The collectionView has multiple sections. If a section has only one cell, the cell appears centered. How can I align that single cell to the left? The collectionView has the following flowLayout: let flowLayout = UICollectionViewFlowLayout() flowLayout.scrollDirection = .vertical flowLayout.sectionInset = UIEdgeInsets(top: 0, left: 0, […]

Wrong reference to custom AVPlayer

I have a UICollectionView with multiple cells (FeedCell). Those cells can also contain a UICollectionView which can also have multiple cells, up to five (MediaSliderCell). Basically, the set up is the same as Instagram: you have a post, and one post can have multiple images or videos. The problem I am now facing is, sometimes […]

By PennyWise
Categorised as avplayer, ios, swift, uicollectionview, uicollectionviewcell

Have cells with data and empty cells in collection view

So what I have is a collection view that looks as such. I have a set amount of cells that I want in the collection view, 16. So if there aren’t enough of the user’s friends (data for the collection view), then I would like the remaining cells from the 16 to just be empty […]

By Jaqueline
Categorised as ios, swift, uicollectionview, uicollectionviewcell

How to set a SwiftUI view as a cell to a CollectionView

I found SwiftUI Text views to be extremely easy to create Labels with custom designs. So I wanted to use it as a view to a regular UIKit UICollectionViewCell. This is my code so far (you can copy and paste inside Xcode 11). import SwiftUI import UIKit struct ContentView: View { var body: some View […]

By swift nub
Categorised as swift, swiftui, uicollectionview, uicollectionviewcell
1 2

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us