1.原因:
新增了一個(gè) preferredDatePickerStyle 導(dǎo)致的默認(rèn)UI樣式變化
/// Request a style for the date picker. If the style changed, then the date picker may need to be resized and will generate a layout pass to display correctly.
@property (nonatomic, readwrite, assign) UIDatePickerStyle preferredDatePickerStyle API_AVAILABLE(ios(13.4)) API_UNAVAILABLE(tvos, watchos);
2.恢復(fù)
if (@available(iOS 14.0, *)) {
self.datePicker.preferredDatePickerStyle = UIDatePickerStyleWheels;
//此處記得再寫一下frame, 在datePickerMode設(shè)置之后
self.datePicker.frame = CGRectMake(0, 50, 290, 160);
}