This is a simple contextMenu. 1) How can I set Text("delete") and Image red.
2) How add divider (image below)
struct customMenu: View {
var onDelete: (() -> Void)?
init(onDelete: @escaping () -> Void) {
self.onDelete = onDelete;
}
var body: some View {
VStack {
if (self.onDelete != nil) {
Button(action: self.onDelete!) {
HStack {
Text("delete")
Image(systemName: "trash")
}
}
}
}
}
}
Very simple, just enter the following:
Divider()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With