我构建了一个 iOS 14 DatePicker。当我从选择器中选择一个日期时,它会以格式显示一些日期,27 Dec 2020
而以格式显示一些日期26/12/2020
。我可以知道是什么问题,我怎样才能使它保持一致?
struct ContentView : View {
@State private var birthDate = Date()
var body: some View {
VStack(alignment: .leading){
DatePicker(selection: $birthDate, in: Date()..., displayedComponents: .date){
Text("Date")
}
}.padding()
}
}