Chapter 7: Accessibility Role

The interaction mechanism of any UI element depends on it’s type. User should know if the element is a button, link, slider, text field or any other element to interact with it. On web we called it is a role or type. In Android it is called as the view and in IOS it is the trait.
The trait or the view has to be exposed to the accessibility services such as talkback and voiceover. The gestures to interact depends on the type of the element.

How to provide an Accessibility role

Android – view

The standard controls in the android development kit provide it for free. IF the content authors create custom controls, the type has to be provided. Use the android:contentDescription attribute to provide the type of the element.
Few more Android Views content authors can use:

  • Text
  • Edittext
  • Button
  • Image
  • Imagebutton
  • Spinner
  • Checkbox
  • Radiobutton
  • Progressbar

IOS – traits

The standard IOS controls provide the trait for free. Content authors no need to put any additional effort for it. However, if the content author create a custom control, the trait has to be set manually.
Use setAccessibilityTraits attribute to set the trait. The below example shows how to set the trait button to an element.
Few more IOS traits content authors can use

  • Null
  • Button
  • Link
  • Search field
  • Images
  • Selected
  • Statictext
  • Summary
  • Header
  • Adjustable

WCAG Success Criteria

4.1.2 Name, Role, Value (Level AA)

Contact Us

Maxability Pvt Ltd Flat 360,
Block D2 SLS Signature Appartments,
Kaverappa Layout, Kadubeesanahalli,
Bangalore - 560103.