这是我的代码
struct ContentView: View {
@State var showingPopover = false
var body: some View {
VStack {
Spacer()
Text("Hello World")
Spacer()
HStack {
Spacer()
Button {
self.showingPopover.toggle()
} label: {
Image(systemName: "plus.circle")
}
.popover(isPresented: $showingPopover) {
List(0..<100) { Text("\($0)") }
}.padding(30)
}
}
}
}
这应该会产生一个来自加号按钮的非常好的弹出框。但我得到的只是一个真正被压扁的弹出框。
知道我在这里缺少什么吗?有没有办法告诉弹出框扩大更多(不指定大小)?