<>Scenario:
- RootScreen presents DateScreen modally though
.sheet
- DateScreen has a DatePicker with CompactDatePickerStyle() and a button to dismiss the modal
- User opens the DatePicker
- User taps the DatePicker to bring up the NumPad for manual keyboard input
- User presses the button to dismiss the modal
页: 1 律师联合会将认为<条码>.sheet已被拒绝,但事实上,只有日标人解职。
<>最低代码:
struct DateScreen: View {
@Binding var isPresented: Bool
@State var date: Date = Date()
var body: some View {
NavigationView {
VStack {
DatePicker("", selection: $date, displayedComponents: [.hourAndMinute])
.datePickerStyle(CompactDatePickerStyle())
}
.navigationBarItems(leading: Button("Dismiss") {
isPresented = false
})
}
}
}
@main
struct Main: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
@State var isPresenting: Bool = false
var body: some Scene {
WindowGroup {
Button("Present modal", action: {
isPresenting = true
})
.sheet(isPresented: $isPresenting, content: {
DateScreen(isPresented: $isPresenting)
})
}
}
}
www.un.org/Depts/DGACM/index_spanish.htm 显示破裂行为:
注:如果用户不打开NumPad,看来工作良好。