[iOS] fix accessibility of Picker (#5145)
authorPavel Yakovlev <v-payako@microsoft.com>
Thu, 22 Aug 2019 11:57:45 +0000 (14:57 +0300)
committerRui Marinho <me@ruimarinho.net>
Thu, 22 Aug 2019 11:57:45 +0000 (12:57 +0100)
Xamarin.Forms.Controls/GalleryPages/PickerGallery.cs
Xamarin.Forms.Platform.iOS/Renderers/DatePickerRenderer.cs
Xamarin.Forms.Platform.iOS/Renderers/PickerRenderer.cs
Xamarin.Forms.Platform.iOS/Renderers/TimePickerRenderer.cs

index 676c907..ae3c43f 100644 (file)
@@ -22,6 +22,7 @@ namespace Xamarin.Forms.Controls
                        p1.SelectedIndexChanged += (sender, e) => {
                                testLabel.Text = "Selected Index Changed";
                        };
+                       p1.SetAutomationPropertiesName("Title picker");
 
                        Content = new ScrollView { 
                                Content = new StackLayout {
index 676ebbf..03d8f08 100644 (file)
@@ -81,6 +81,8 @@ namespace Xamarin.Forms.Platform.iOS
 
                                _useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
 
+                               entry.AccessibilityTraits = UIAccessibilityTrait.Button;
+
                                SetNativeControl(entry);
                        }
 
index 49a3678..e13ea6d 100644 (file)
@@ -85,9 +85,11 @@ namespace Xamarin.Forms.Platform.iOS
                                        entry.InputAssistantItem.TrailingBarButtonGroups = null;
 
                                        _defaultTextColor = entry.TextColor;
-                                       
+
                                        _useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
 
+                                       entry.AccessibilityTraits = UIAccessibilityTrait.Button;
+
                                        SetNativeControl(entry);
                                }
 
index 6d85dba..e4bc681 100644 (file)
@@ -91,6 +91,8 @@ namespace Xamarin.Forms.Platform.iOS
 
                                        _picker.ValueChanged += OnValueChanged;
 
+                                       entry.AccessibilityTraits = UIAccessibilityTrait.Button;
+
                                        SetNativeControl(entry);
                                }