Skip to content

How can I correctly invalidate cell layout in Chatto in order to relaclulate specific cell height? #795

@sergeiromanchuk

Description

@sergeiromanchuk

I tried to invalidate layer for a specific cell in the collection, it doesn't help, it only turns out to redraw a certain number of cells using the enqueueModelUpdate method.

let layout = collectionView?.collectionViewLayout

layout?.invalidateLayout()

// or

let indexPath = collectionView?.indexPath(for: cell)
if let layout, let indexPath {
    let context = UICollectionViewLayoutInvalidationContext()
    context.invalidateItems(at: [indexPath])
    layout.invalidateLayout(with: context)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions