ImageView Name

Link to ImageView Name copied to clipboard

WCAG 2.0 - 1.1.1 A Impact - Critical

ImageView elements must provide a name.

Supported within:
XML Layouts

Impact

People that use TalkBack will be the most impacted by issues found. If an ImageView provides information to users with vision and doesn't provide a name, TalkBack will not announce anything, and that information is missing for user experiences with TalkBack.

Informative images should utilize contentDescription to provide any necessary context and details through TalkBack.

Confirmation

  1. Turn on TalkBack
  2. Perform a "touch to explore" gesture on the control
  3. For informative images:
    • Accessible: Receives focus and announces a meaningful description.


    For decorative images:
    • Accessible: Does not receive focus individually. Within a group is accepted.

How to Fix

ImageView image = .......; // Role: Image
image.setContentDescription("Tasty Chocolates"); // Name: Tasty Chocolates.