View Source LazyHGrid
<LazyHGrid>
Grid that grows horizontally.
Overview
Use the rows
attribute to configure the presentation of the grid.
<LazyHGrid
rows={[
%{ size: %{ fixed: 100 } },
%{ size: :flexible },
%{ size: %{ adaptive: %{ minimum: 50 } } }
]}
>
<%= for i <- 1..50 do %>
<Text id={i |> Integer.to_string}><%= i %></Text>
<% end %>
</LazyHGrid>
There are 3 types of grid item:
fixed(size, spacing, alignment)
: creates a single row that takes up the specified amount of space.flexible(minimum, maximum, spacing, alignment)
: creates a single row that fills the available space.adaptive(minimum, maximum, spacing, alignment)
: fills the available space with as many rows as will fit.
Attributes
SwiftUI Documentation
See SwiftUI.LazyHGrid
for more details on this View.
References
Link to this reference
alignment
The alignment between rows.
Link to this reference
pinnedViews
Pins section headers/footers.
Discussion
Configured rows to fill with the child elements.
Link to this reference
spacing
The spacing between rows.