Skip to content

FlowLayout

Luke Zhao edited this page Aug 16, 2018 · 3 revisions

FlowLayout

FlowLayout is similar to UICollectionViewFlowLayout where it aligns items in row by row, from left to right, top to bottom.

Spacing

  • interItemSpacing is the space between two cells within the same row

  • lineSpacing is the space between two rows

    When constructing a FlowLayout, you can also specify a spacing parameter which will apply to both interItemSpacing and lineSpacing.

Flexbox

FlowLayout also support some of the Flexbox properties. These include justifyContents, alignItems, and alignContents.

  • justifyContents tells FlowLayout how to handle horizontal empty spaces within a row. This happens when all the cells with in a row including their spacing doesn’t fill the entire row.

    • .start puts all the cells near
  • alignItems tells FlowLayout how to handle vertical spacing with in a row. Note that if all the cells with in a row have the same height, alignItems does nothing. It only applies to cells that are not the tallest within a row.

    • .start
  • alignContents is similar to justifyContents. But it handles the vertical empty spaces within a collection. FlowLayout use this value to distribute rows in the vertical axis if all the rows cannot fill the entire vertical space.

    • .start

Clone this wiki locally