CollectionViewListCell Indentation

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.

Answered by mredig in 676684022

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
	}
Accepted Answer

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
	}
CollectionViewListCell Indentation
 
 
Q