How can the order of elements in the Accessibility Tree (a.k.a. Accessibility UI) be specified for a Xamarin.Forms app? In a native iOS app I would override accessibilityElements, but XF doesn't seem to have an equivalent.
The order required for a particular page is not the same as Left-Right, Top-Bottom even in locales where the visual UI would be read that way, nor is it the same as the tab order (i.e. IsTabStop + TabIndex combination) of the visual UI. The order for accessibility needs to include some elements that have IsTabStop = false for the visual UI. Also, I am not using Shell.
Answers
TabIndex
is used to specify order of elements .And The docs says
IsTabStop
is true by default , when its value is false the control is ignored by the tab-navigation infrastructure .The problem is that the order required for the Accessibility UI (a.k.a. accessibility tree) is not always the same as the tab order in the Visual UI.
I've logged an enhancement request at https://github.com/xamarin/Xamarin.Forms/issues/13006
In the meantime, I'm investigating ways of doing this using custom renderers and a dependency service. It's made painful by things being internal, and methods being non-virtual, in the built-in renderers.