From 7d4e9684117127f4a8cf147e3564a98f92822aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=89=91=E5=AE=A2?= Date: Sun, 27 Sep 2020 21:03:40 +0800 Subject: [PATCH 1/2] [iOS] fix input component wakeup UIDatePicker --- ios/sdk/WeexSDK/Sources/Manager/WXDatePickerManager.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXDatePickerManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXDatePickerManager.m index 7439b6b5d4..a626a12a86 100644 --- a/ios/sdk/WeexSDK/Sources/Manager/WXDatePickerManager.m +++ b/ios/sdk/WeexSDK/Sources/Manager/WXDatePickerManager.m @@ -63,6 +63,9 @@ - (instancetype)init } datePicker.datePickerMode=UIDatePickerModeDate; + if (@available(iOS 13.4, *)) { + datePicker.preferredDatePickerStyle = UIDatePickerStyleWheels; + } CGRect pickerFrame = CGRectMake(0, 44, [UIScreen mainScreen].bounds.size.width, WXPickerHeight-44); datePicker.backgroundColor = [UIColor whiteColor]; datePicker.frame = pickerFrame; From faf65f13208e61b90401538698bd07b58b2b9197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=89=91=E5=AE=A2?= Date: Mon, 28 Sep 2020 14:24:40 +0800 Subject: [PATCH 2/2] fix --- ios/sdk/WeexSDK/Sources/Manager/WXDatePickerManager.m | 2 ++ ios/sdk/WeexSDK/Sources/Module/WXPickerModule.m | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXDatePickerManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXDatePickerManager.m index a626a12a86..9c67181b19 100644 --- a/ios/sdk/WeexSDK/Sources/Manager/WXDatePickerManager.m +++ b/ios/sdk/WeexSDK/Sources/Manager/WXDatePickerManager.m @@ -63,9 +63,11 @@ - (instancetype)init } datePicker.datePickerMode=UIDatePickerModeDate; +#ifdef __IPHONE_13_4 if (@available(iOS 13.4, *)) { datePicker.preferredDatePickerStyle = UIDatePickerStyleWheels; } +#endif CGRect pickerFrame = CGRectMake(0, 44, [UIScreen mainScreen].bounds.size.width, WXPickerHeight-44); datePicker.backgroundColor = [UIColor whiteColor]; datePicker.frame = pickerFrame; diff --git a/ios/sdk/WeexSDK/Sources/Module/WXPickerModule.m b/ios/sdk/WeexSDK/Sources/Module/WXPickerModule.m index 4c459ed1c3..c5b57a3206 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXPickerModule.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXPickerModule.m @@ -432,9 +432,11 @@ - (void)createDatePicker:(NSDictionary *)options callback:(WXModuleKeepAliveCall { self.callback = callback; self.datePicker = [[UIDatePicker alloc]init]; +#ifdef __IPHONE_13_4 if (@available(iOS 13.4, *)) { - self.datePicker.preferredDatePickerStyle = UIDatePickerStyleWheels; + self.datePicker.preferredDatePickerStyle = UIDatePickerStyleWheels; } +#endif if (UIDatePickerModeDate == self.datePickerMode) { self.datePicker.datePickerMode = UIDatePickerModeDate; NSString *value = [WXConvert NSString:options[@"value"]];