View Source LazyVGrid

<LazyVGrid>

Grid that grows vertically.

Overview

Use the columns attribute to configure the presentation of the grid.

<LazyVGrid
    columns={[
        %{ size: %{ fixed: 100 } },
        %{ size: :flexible },
        %{ size: %{ adaptive: %{ minimum: 50 } } }
    ]}
>
    <%= for i <- 1..50 do %>
        <Text id={i |> Integer.to_string}><%= i %></Text>
    <% end %>
</LazyVGrid>

There are 3 types of grid item:

  • fixed(size, spacing, alignment): creates a single column that takes up the specified amount of space.
  • flexible(minimum, maximum, spacing, alignment): creates a single column that fills the available space.
  • adaptive(minimum, maximum, spacing, alignment): fills the available space with as many columns as will fit.

Attributes

SwiftUI Documentation

See SwiftUI.LazyVGrid for more details on this View.

References

The alignment between columns.

Configured columns to fill with the child elements.

Pins section headers/footers.

Discussion

See PinnedScrollableViews.

The spacing between rows.