HomeiOS Developmentios - How you can scale back cell peak (vertical margins) when...

ios – How you can scale back cell peak (vertical margins) when utilizing UIListContentConfiguration


The default cell peak is 44pt in iOS 18 and 52pt in iOS 26. I am attempting to cut back the peak again to 44pt in a single display that should match as a lot content material on display as potential. How do you try this when utilizing UIListContentConfiguration?

I anticipated this is able to do the trick however alas it would not scale back the cell peak.

let cellRegistration = UICollectionView.CellRegistration { cell, indexPath, merchandise in
    cell.contentConfiguration = {
        var config = UIListContentConfiguration.valueCell()
        config.textual content = "Title"
        config.secondaryText = "Worth"

        // This solely removes horizontal margins, doesn't change vertical margins
        config.axesPreservingSuperviewLayoutMargins = []
        config.directionalLayoutMargins = .zero
        return config
    }()
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments