我在项目中使用了 UICollectionView,其中在一条线上有多个宽度不同的单元格。根据: Https://developer.apple.com/library/content/documentation/windowsviews/conceptual/collectionviewpgforios/usingtheflowlayout/usingtheflowlayout.html
它用相同的填充物将细胞分散在整条线上。这发生在意料之中,除了我想左对齐他们,硬代码一个填充宽度。
I figure I need to subclass UICollectionViewFlowLayout, however after reading some of the tutorials etc online I just don't seem to get how this works.