material-components-ios
material-components-ios copied to clipboard
MDCChipCollectionViewFlowLayout support for horizontal scroll direction
Feature Request/Suggestion
Does MDCChipCollectionViewFlowLayout support horizontal scroll? When I set
layout.scrollDirection = .horizontal
I get my layout broken, much like here https://github.com/material-components/material-components-ios/issues/5671 with overlapping items. It would be nice to have the horizontal scroll mode supported.
@algrid, I have also encountered this issue when using horizontal scroll inside UITableViewCell(), was very frustrating, I was searching for solution and encountered this open issue.
I have solved this problem by setting the layout to be UICollectionViewFlowLayout() instead of MDCChipCollectionViewFlowLayout()
let layout = UICollectionViewFlowLayout()
layout.estimatedItemSize = UICollectionViewFlowLayout.automaticSize
layout.scrollDirection = .horizontal
collectionView.collectionViewLayout = layout
layoutIfNeeded()