let columns: [GridItem] = [GridItem(.flexible()),
GridItem(.flexible()),
GridItem(.flexible())]
struct ContentView: View {
var body: some View {
GeometryReader { geometry in
VStack{
Spacer()
ZStack {
LazyVGrid(columns: columns) {
Circle()
.frame(width: 100, height: 100)
.foregroundColor(Color(.systemBlue))
.opacity(0.5)
Circle()
.frame(width: 100, height: 100)
.foregroundColor(Color(.systemBlue))
.opacity(0.5)
Circle()
.frame(width: 100, height: 100)
.foregroundColor(Color(.systemBlue))
.opacity(0.5)
Circle()
.frame(width: 100, height: 100)
.foregroundColor(Color(.systemBlue))
.opacity(0.5)
Circle()
.frame(width: 100, height: 100)
.foregroundColor(Color(.systemBlue))
.opacity(0.5)
Circle()
.frame(width: 100, height: 100)
.foregroundColor(Color(.systemBlue))
.opacity(0.5)
Circle()
.frame(width: 100, height: 100)
.foregroundColor(Color(.systemBlue))
.opacity(0.5)
Circle()
.frame(width: 100, height: 100)
.foregroundColor(Color(.systemBlue))
.opacity(0.5)
Circle()
.frame(width: 100, height: 100)
.foregroundColor(Color(.systemBlue))
.opacity(0.5)
Rectangle()
.frame(width: 200, height: 80)
.foregroundColor(Color(.systemBlue))
.opacity(0.5)
.cornerRadius(60)
.position(x: 114, y: 55)
Circle()
}
}
Spacer()
}
}
}
}
struct contentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
.previewInterfaceOrientation(.portrait)
}
}
In the last Circle(), it shows me Error.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: