From the course: Complete Guide to SwiftUI

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Grids

Grids

- [Instructor] While we've been using HStack and VStack to keep things organized, there's another layout mechanism you may use at times. Grids, not to be confused with the lazy grids we learned earlier, are a static layout mechanism for spreadsheet-like grids. Grids size for a layout of equally sized cells. It takes the views in a row and calculates the height for them to be equal. Similarly, it takes the height of the cell in each column and calculates an equal width for each column. So we're going to start with a new SwiftUI view called ReceiptView. And so I'm going to go ahead and close up the simulator here and shut that down. We'll go over here. I'm just going to go click under StyleSheet and do a Command + N so we're in the right place and get a SwiftUI view and call it ReceiptView. And things like reports are really good for this, which is why I'm using a receipt view, 'cause what we'll do is we'll make a little report. Okay, and I'm going to just take this whole thing here and…

Contents