如何使内部的按钮
执行其操作,而不是始终执行外部的按钮?
struct Foo: View {
var body: some View {
Button(action: { print("alloha") }) {
HStack {
Button(action: { print("hello") }) {
Image(systemName: "circle.fill")
}
Text("world")
Spacer()
}
}
}
}
.overlay
将较小的按钮放在顶部。 - TruMan1