Added iOS version check for crashing code (#6862) fixes #6847
authorGerald Versluis <gerald.versluis@microsoft.com>
Thu, 25 Jul 2019 16:40:56 +0000 (18:40 +0200)
committerRui Marinho <me@ruimarinho.net>
Thu, 25 Jul 2019 16:40:56 +0000 (17:40 +0100)
Xamarin.Forms.Platform.iOS/Renderers/PickerRenderer.cs

index 4cd45fb..073cfce 100644 (file)
@@ -81,9 +81,12 @@ namespace Xamarin.Forms.Platform.iOS
 
                                        entry.InputView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight;
                                        entry.InputAccessoryView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight;
-                                       
-                                       entry.InputAssistantItem.LeadingBarButtonGroups = null;
-                                       entry.InputAssistantItem.TrailingBarButtonGroups = null;
+
+                                       if (Forms.IsiOS9OrNewer)
+                                       {
+                                               entry.InputAssistantItem.LeadingBarButtonGroups = null;
+                                               entry.InputAssistantItem.TrailingBarButtonGroups = null;
+                                       }
 
                                        _defaultTextColor = entry.TextColor;