From c97a1a989d5e5335ec2c1ce542ede5d78d670e0a Mon Sep 17 00:00:00 2001 From: DongQing Date: Tue, 16 Dec 2025 14:53:29 +0800 Subject: [PATCH] Update delete confirmation sheet style --- IdeaNote/IdeaNote/ContentView.swift | 41 ++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/IdeaNote/IdeaNote/ContentView.swift b/IdeaNote/IdeaNote/ContentView.swift index 14e71b6..e79dd07 100644 --- a/IdeaNote/IdeaNote/ContentView.swift +++ b/IdeaNote/IdeaNote/ContentView.swift @@ -163,16 +163,37 @@ struct NoteListRow: View { NewNoteView(noteModel: noteModel) }) // 删除笔记 - .actionSheet(isPresented: $showingActionSheet) { - return ActionSheet( - title: Text("你确定要删除此项吗?"), - message: nil, - buttons: [ - .destructive(Text("删除"), action: { - self.viewModel.deleteItem(item: noteModel) - }), - .cancel(Text("取消")), - ]) + .sheet(isPresented: $showingActionSheet) { + VStack(spacing: 20) { + Text("你确定要删除此项吗?") + .font(.system(size: 17)) + .bold() + + Button(action: { + self.viewModel.deleteItem(item: noteModel) + showingActionSheet = false + }, label: { + Text("删除") + .frame(maxWidth: .infinity) + .padding() + .background(Color.yellow) + .foregroundStyle(.black) + .cornerRadius(12) + }) + + Button(action: { + showingActionSheet = false + }, label: { + Text("取消") + .frame(maxWidth: .infinity) + .padding() + .background(Color(.systemGray5)) + .foregroundStyle(.black) + .cornerRadius(12) + }) + } + .padding() + .presentationDetents([.height(200)]) } } }