Skip to content

Commit

Permalink
[Fix] 다이어리 작성 뷰 onTapGesture 수정 #116
Browse files Browse the repository at this point in the history
다이어리 작성 후 화면 터치하면 키보드 내려가는데 작성완료 버튼 안나왔던 이슈 해결,
키보드 내려가는 onTapGesture 위치 수정.(텍스트필드는 터치해도 안내려가게)
  • Loading branch information
chasomin committed Feb 13, 2023
1 parent 785a771 commit 0cde3cb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

}
Expand Down
33 changes: 18 additions & 15 deletions BootCamping/BootCamping/Views/MyCampingDiary/DiaryAddView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -137,9 +142,7 @@ struct DiaryAddView: View {
}
}
.navigationTitle(Text("캠핑 일기 쓰기"))
.onTapGesture {
dismissKeyboard()
}

.disableAutocorrection(true) //자동 수정 비활성화
.textInputAutocapitalization(.never) //첫 글자 대문자 비활성화
.toolbar {
Expand Down

0 comments on commit 0cde3cb

Please sign in to comment.