size
TypeScriptget size(): GridItem_SizeSwift declarationvar size: GridItem.SizeThe size of the item, which is the width of a column item or the height of a row item.
struct · iOS 14.0+ · SDK 27.1
struct GridItemA description of a row or a column in a lazy grid. Use an array of `GridItem` instances to configure the layout of items in a lazy grid. Each grid item in the array specifies layout properties like size and spacing for the rows of a ``LazyHGrid`` or the columns of a ``LazyVGrid``. The following example defines four rows for a horizontal grid, each with different characteristics: struct GridItemDemo: View { let rows = [ GridItem(.fixed(30), spacing: 1), GridItem(.fixed(60), spacing: 10), GridItem(.fixed(90), spacing: 20), GridItem(.fixed(10), spacing: 50) ] var body: some View { ScrollView(.horizontal) { LazyHGrid(rows: rows, spacing: 5) { ForEach(0...300, id: \.self) { _ in Color.red.frame(width: 30) Color.green.frame(width: 30) Color.blue.frame(width: 30) Color.yellow.frame(width: 30) } } } } } A lazy horizontal grid sets the width of each column based on the widest cell in the column. It can do this because it has access to all of the views in a given column at once. In the example above, the ``Color`` views always have the same fixed width, resulting in a uniform column width across the whole grid. However, a lazy horizontal grid doesn't generally have access to all the views in a row, because it generates new cells as people scroll through information in your app. Instead, it relies on a grid item for information about each row. The example above indicates a different fixed height for each row, and sets a different amount of spacing to appear after each row: 
get size(): GridItem_SizeSwift declarationvar size: GridItem.SizeThe size of the item, which is the width of a column item or the height of a row item.
set size(value: GridItem_Size)Swift declarationvar size: GridItem.SizeThe size of the item, which is the width of a column item or the height of a row item.
get spacing(): (number) | nullSwift declarationvar spacing: CGFloat?The spacing to the next item. If this value is `nil`, the item uses a reasonable default for the current platform.
set spacing(value: (number) | null)Swift declarationvar spacing: CGFloat?The spacing to the next item. If this value is `nil`, the item uses a reasonable default for the current platform.
get alignment(): (_SwiftUICore_Alignment) | nullSwift declarationvar alignment: Alignment?The alignment to use when placing each view. Use this property to anchor the view's relative position to the same relative position in the view's assigned grid space.
set alignment(value: (_SwiftUICore_Alignment) | null)Swift declarationvar alignment: Alignment?The alignment to use when placing each view. Use this property to anchor the view's relative position to the same relative position in the view's assigned grid space.
static init(size?: GridItem_Size, spacing?: (number) | null, alignment?: (_SwiftUICore_Alignment) | null): GridItemSwift declarationinit(_ size: GridItem.Size = .flexible(), spacing: CGFloat? = nil, alignment: Alignment? = nil)Creates a grid item with the specified size, spacing, and alignment. - Parameters: - size: The size of the grid item. - spacing: The spacing to use between this and the next item. - alignment: The alignment to use for this grid item.
No declarations were skipped in this snapshot.