Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To ensure that all items in a LazyVGrid have equal height in SwiftUI, you can use the frame modifier with a fixed height value on each item. For example:

LazyVGrid(columns: columns, spacing: spacing) {
    ForEach(items) { item in
        ItemView(item: item)
            .frame(height: 100) // Fixed height for all items
    }
}

This will ensure that all items in the grid have the same height of 100 points. You can adjust the height value as needed based on your design requirements.