Workaround for Date Picker in iOS14

Summary:
iOS14 has introduced new styles for date picker. The default new calendar style breaks the old spinner type style.

This is a workaround to keep the spinner style as a default, until the calendar style is properly supported. According to [this github comment](https://github.com/react-native-community/datetimepicker/issues/285) it works well.

This will fix DatePicker for both Fabric and Paper, since Fabric uses the interop layer to render it.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23935328

fbshipit-source-id: 1a7fadba274e0537f0ac4ced60e23e7c809d57dc
This commit is contained in:
Peter Argany 2020-09-25 11:34:54 -07:00 коммит произвёл Facebook GitHub Bot
Родитель c2447d3f76
Коммит c015f485c2
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -24,6 +24,10 @@
if ((self = [super initWithFrame:frame])) {
[self addTarget:self action:@selector(didChange) forControlEvents:UIControlEventValueChanged];
_reactMinuteInterval = 1;
if (@available(iOS 14, *)) {
self.preferredDatePickerStyle = UIDatePickerStyleWheels;
}
}
return self;
}