Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozzieperez/5c9cae3cb47264df0c99 to your computer and use it in GitHub Desktop.
Save ozzieperez/5c9cae3cb47264df0c99 to your computer and use it in GitHub Desktop.
Xamarin.Forms Accessibility - Change the default element selected when screen changes.
// Change default element selected when the screen changes.
// In the view controller...
public override void ViewDidAppear(bool animated)
{
base.ViewDidAppear (animated);
//pass in the object to get focus
UIAccessibility.PostNotification(UIAccessibilityPostNotification.ScreenChanged, myObject);
}
// In a constructor or callback, set the text spoken by voiceover when the element is selected...
myObject.AccessibilityLabel = “Say something useful.”;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment