So I've got this very basic grid. It's 5 columns and should have 3 rows. But I can't get the compiler to compile anything more than two rows....
The compiler complains : 'Extra arguments at positions #11, #12, #13, #14, #15 in call'
If I remove Text 6 to 10 it does compile....
Code:
struct ContentView: View {
var columns = [
GridItem(spacing: 8, alignment: .leading),
GridItem(spacing: 8, alignment: .center),
GridItem(spacing: 8, alignment: .center),
GridItem(spacing: 8, alignment: .center),
GridItem(spacing: 8, alignment: .center)
]
var body: some View {
LazyVGrid(columns: columns, spacing: 8) {
Text("Buttons").font(.headline)
Text("resting").font(.subheadline)
Text("active").font(.subheadline)
Text("loading").font(.subheadline)
Text("disabled").font(.subheadline)
Text("1").font(.headline)
Text("2").font(.subheadline)
Text("3").font(.subheadline)
Text("4").font(.subheadline)
Text("5").font(.subheadline)
Text("6").font(.headline)
Text("7").font(.subheadline)
Text("8").font(.subheadline)
Text("9").font(.subheadline)
Text("10").font(.subheadline)
}.padding(.horizontal, 10)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}