In Android Studio, using Java, to set the accessibility focus on a certain view after, for example, pressing a button, you have to do myview.sendAccessibilityEvent(AccessibilityEvent.WINDOWS_CHANGE_ACCESSIBILITY_FOCUSED)
. In Xamaring, using C#, the closest thing that I found is myview.SendAccessibilityEvent(EventTypes.ViewAccessibilityFocused);
but it doesn't work that good, infact, it only read out the myview
accessibility name, without actually setting the focus on that, the focus remain on the button pressed. I also tried myview.SendAccessibilityEvent(EventTypes.ViewFocused);
but it doesn't work either.
Another thing that I found is myview.SendAccessibilityEventUnchecked(AccessibilityEvent.WindowsChangeAccessibilityFocused);
but I got an error saying Argument 1: cannot convert from 'Android.Views.Accessibility.WindowsChange' to 'Android.Views.Accessibility.AccessibilityEvent'
even if it is said that SendAccessibilityEventUnchecked
takes an AccessibilityEvent
as argument.
Any idea on how to solve?
Or any idea on how to set the accessibility focus to a certain view after some event?
(Note if needed, I am just testing it on Android native, than I will need to use that in a Forms project using Dependency Service)
↧
Android change accessibility focus
↧