ImageView element accessibility label
The ImageView element accessibility label rule ensures that the elements in your app that convey information graphically, such as ImageView
or ImageButton
, have a descriptive and meaningful accessibility label. These labels are essential for screen readers to interpret the graphic’s content and purpose, making the app accessible to users with visual impairments.
Testing for ImageView element accessibility labels is necessary as it ensures that all users, regardless of their abilities, can understand and interact with the app’s visual content effectively.
- Rule Category :
Accessible Images
- WCAG 2.1 & 2.2 SC :
1.1.1 (A)
- Rule Severity :
Critical
- Supported Platforms :
Android
,iOS
Success criteria
The specific criteria for success are:
-
ImageView
orImageButton
elements that convey meaningful information should include a clear description that articulates the visual content and purpose. - The description should be accessible by assistive technologies.
AI-powered testing
BrowserStack provides an AI-powered Issue Detection Agent that analyzes non-decorative image elements (such as, ImageView
or ImageButton
) and evaluates their assigned accessibility labels for accuracy and contextual relevance. If the label is missing or inaccurate, the agent suggests a meaningful and contextually appropriate label based on the image’s content and purpose within the app.
AI-powered results are clearly marked in the report so you can review and apply suggestions as needed.
The Issue Detection Agent performs the following checks:
-
Detects and evaluates accessibility labels
- Identifies whether non-decorative images have an assigned accessibility label.
- Compares the label with the image’s visual content and context to confirm it accurately describes the element’s purpose.
-
Suggests meaningful labels
- Generates a descriptive label when the existing one is missing or inaccurate.
- Suggests the label in the same language as the surrounding screen content.
For more information about the Issue Detection Agent, see Issue Detection Agent.
How to fix
Manual fix
To fix ImageView element accessibility label violations manually:
- Add the
contentDescription
property to non-decorativeImageView
orImageButton
elements that describe their purpose and function. - For example, if the
ImageView
element is a button to open the gallery, setcontentDescription
toOpen Gallery
.
- Add the
accessibilityLabel
property to non-decorativeUIImageView
orUIButton
elements that describe their purpose and function. - For example, if the
UIImageView
element is a button to open the gallery, setaccessibilityLabel
toOpen Gallery
.
AI-powered fix
You can use the AI-powered suggestions to add contextually relevant labels to the image elements. AI-suggested labels are clearly highlighted in the report for your review.
The AI engine only generates the suggestions. You must manually review and implement the suggestions in your codebase using the steps mentioned in the Manual fix section.
Example
The following example scan report highlights an informative ImageView
element is present at the bottom right corner of the screen without an appropriate accessibility label. It is indicated by contentDescription: ""
. The ImageView
, represented by an icon, is used to convey meaningful information (in this case, it might be a shortcut to access the gallery or perform a specific action). However, as it lacks a descriptive label, screen readers will not be able to narrate the context of this image, making it inaccessible to users with visually difficulties.
Fix
Add a contentDescription
property to the ImageView
element that clearly describes its purpose.
For example, if the ImageView
is a button to open the gallery, the contentDescription
should be something like Open Gallery
.
Add an accessibilityLabel
property to the UIImageView
element that clearly describes its purpose.
For example, if the UIImageView
is a button to open the gallery, the accessibilityLabel
should be something like Open Gallery
.
References
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!