如何使用SwiftUI在DatePicker中缩小日期的字体?
struct TestView: View {
@State private var eventDate = Date()
var body: some View {
ZStack {
Color(.purple).edgesIgnoringSafeArea(.all)
VStack {
Section {
DatePicker("Event Date", selection: $eventDate, in: ...Date())
.labelsHidden()
}
}
}
}
}
答案 0 :(得分:0)
您可以应用var body: some View {
ZStack {
Color(.purple).edgesIgnoringSafeArea(.all)
VStack {
Section {
DatePicker("Event Date", selection: $eventDate, in: ...Date())
.labelsHidden()
.transformEffect(.init(scaleX: 0.7, y: 0.7))
}
}
}
}
:
{{1}}