点击空白区域隐藏键盘

This commit is contained in:
2026-07-12 16:02:51 +08:00
parent bbff0c238d
commit 78bf2031b8
+3
View File
@@ -40,6 +40,9 @@ struct FormatterView: View {
.padding() .padding()
.navigationTitle("文案格式化") .navigationTitle("文案格式化")
.background(Color(hex: "f2f2f7").ignoresSafeArea()) .background(Color(hex: "f2f2f7").ignoresSafeArea())
.onTapGesture {
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
}
.navigationDestination(item: $resultText) { text in .navigationDestination(item: $resultText) { text in
ResultView(formattedText: text) ResultView(formattedText: text)
} }