From 44660190da3c38a5d4ffe57210caa18c65e65c5f Mon Sep 17 00:00:00 2001 From: fish Date: Sun, 12 Jul 2026 16:54:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=E7=BB=93=E6=9E=9C=E6=97=B6=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E6=A0=BC=E5=BC=8F=E5=8C=96=E7=BB=93=E6=9E=9C=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Note/FormatterView.swift | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/Note/FormatterView.swift b/Note/FormatterView.swift index 4bad4ad..9b398de 100644 --- a/Note/FormatterView.swift +++ b/Note/FormatterView.swift @@ -18,7 +18,9 @@ struct FormatterView: View { List { inputSection actionSection - resultSection + if !outputText.isEmpty { + resultSection + } } .listStyle(.insetGrouped) .navigationTitle("文案格式化") @@ -83,25 +85,18 @@ struct FormatterView: View { private var resultSection: some View { Section { - if outputText.isEmpty { - Text("点击上方按钮生成格式化结果") - .foregroundStyle(.secondary) - } else { - TextEditor(text: .constant(outputText)) - .frame(minHeight: 160) - .scrollContentBackground(.hidden) - .background(Color(.secondarySystemGroupedBackground)) - } + TextEditor(text: .constant(outputText)) + .frame(minHeight: 160) + .scrollContentBackground(.hidden) + .background(Color(.secondarySystemGroupedBackground)) } header: { HStack { Text("格式化结果") Spacer() - if !outputText.isEmpty { - Button(action: copyOutput) { - Image(systemName: "doc.on.doc") - } - .font(.subheadline) + Button(action: copyOutput) { + Image(systemName: "doc.on.doc") } + .font(.subheadline) } } }