What if we want to use outlined/disclosed lists, but we don't want indentation on child cells?
I have tried overriding indentationLevel
and indentationWidth
on a subclass of UICollectionViewListCell
, but it appears that those properties are ultimately ignored.
Turns out I'm ****** and it's easy. Just set the value when you are configuring the cell in whatever cellForItemAt
variant you are using.
func configureCell(_ cell: UICollectionViewListCellSubclass, indexPath: IndexPath, item: DataSourceItem) {
cell.titletext = "Cell Title"
cell.subtitleText = "1/2/2021"
cell.indentationLevel = 0 // or whatever
}