Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DevLog/UI/Setting/PushNotificationSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ struct PushNotificationSettingsView: View {
)
.datePickerStyle(.wheel)
.labelsHidden()
.presentationDragIndicator(.hidden)
.presentationDetents([.height(viewModel.state.sheetHeight)])
.onAppear { UIDatePicker.appearance().minuteInterval = 5 }
.onDisappear { UIDatePicker.appearance().minuteInterval = 1 /* 기본값으로 복원 */ }
.toolbar {
Expand All @@ -105,6 +103,8 @@ struct PushNotificationSettingsView: View {
}
)
}
.presentationDragIndicator(.hidden)
.presentationDetents([.height(viewModel.state.sheetHeight)])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

.presentationDetents에 사용되는 viewModel.state.sheetHeight 값이 DatePicker의 높이만을 기준으로 계산되고 있습니다. NavigationStack에 의해 추가되는 네비게이션 바의 높이가 포함되지 않아 시트의 상단 컨텐츠(네비게이션 바)가 잘릴 수 있습니다.

sheetHeight를 계산하는 GeometryReaderNavigationStack 전체에 적용하여 시트의 전체 컨텐츠 높이를 측정하도록 수정하는 것을 고려해보세요.

예시:

NavigationStack {
    // ... DatePicker and toolbar ...
}
.background(
    GeometryReader { geometry in
        Color.clear.onAppear {
            viewModel.send(.setSheetHeight(geometry.size.height))
        }
    }
)
.presentationDragIndicator(.hidden)
.presentationDetents([.height(viewModel.state.sheetHeight)])

}
}

Expand Down