2024-12-24
actionSheets允许设计更多的按钮。底部菜单而不是中间菜单。
Vstack{}
.confirmationDialog("Do you really want to delete the item?", isPresented: $showConfirmationDialog, titleVisibility: .visible) {
if(who=="me"){
Button("Delete"){backgroundColor = .red}
}else{
Button("Share"){backgroundColor = .yellow}
Button("Report"){backgroundColor = .blue}
}
} message: {
Text("The action cannot be undone.")
}