From 0cde3cb71c0a2b9e370e57da7a1cfaf25b8917aa Mon Sep 17 00:00:00 2001 From: chasomin Date: Tue, 14 Feb 2023 01:43:04 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20=EB=8B=A4=EC=9D=B4=EC=96=B4=EB=A6=AC=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1=20=EB=B7=B0=20onTapGesture=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20#116?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 다이어리 작성 후 화면 터치하면 키보드 내려가는데 작성완료 버튼 안나왔던 이슈 해결, 키보드 내려가는 onTapGesture 위치 수정.(텍스트필드는 터치해도 안내려가게) --- .../Components/UIScreen+Extension.swift | 2 +- .../Views/MyCampingDiary/DiaryAddView.swift | 33 ++++++++++--------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/BootCamping/BootCamping/Components/UIScreen+Extension.swift b/BootCamping/BootCamping/Components/UIScreen+Extension.swift index 41ab9d3..0a08a42 100644 --- a/BootCamping/BootCamping/Components/UIScreen+Extension.swift +++ b/BootCamping/BootCamping/Components/UIScreen+Extension.swift @@ -84,7 +84,7 @@ extension Image { return Image(uiImage: img) } func resizeImageData(data: Data) -> Image { - guard let img = UIImage(data: data)?.resize(newWidth: UIScreen.screenWidth * 1 / 10) else { fatalError("Fail to load image") } + guard let img = UIImage(data: data)?.resize(newWidth: UIScreen.screenWidth * 1 / 15) else { fatalError("Fail to load image") } return Image(uiImage: img) } diff --git a/BootCamping/BootCamping/Views/MyCampingDiary/DiaryAddView.swift b/BootCamping/BootCamping/Views/MyCampingDiary/DiaryAddView.swift index 0a4d464..0b3f188 100644 --- a/BootCamping/BootCamping/Views/MyCampingDiary/DiaryAddView.swift +++ b/BootCamping/BootCamping/Views/MyCampingDiary/DiaryAddView.swift @@ -75,18 +75,23 @@ struct DiaryAddView: View { VStack { ScrollView{ VStack(alignment: .leading) { - imagePicker - Divider() - addViewLocationInfo - .padding(.vertical, 10) - Divider() - - addViewVisitDate - Divider() - - addViewIsPrivate - Divider() - + Group{ + imagePicker + Divider() + addViewLocationInfo + .padding(.vertical, 10) + Divider() + + addViewVisitDate + Divider() + + addViewIsPrivate + Divider() + } + .onTapGesture { + isTapTextField = false + dismissKeyboard() + } Group{ //diaryTitle TextField("제목을 입력해주세요(최대 20자)", text: $diaryTitle) @@ -137,9 +142,7 @@ struct DiaryAddView: View { } } .navigationTitle(Text("캠핑 일기 쓰기")) - .onTapGesture { - dismissKeyboard() - } + .disableAutocorrection(true) //자동 수정 비활성화 .textInputAutocapitalization(.never) //첫 글자 대문자 비활성화 .toolbar {