What is the purpose of contentDescription?

Asked

Viewed 2,263 times

4

I have in my application I have several Warning's as stated below:

[Accessibility] Missing contentDescription attribute on image

Imagery

inserir a descrição da imagem aqui

I did some research and found that it’s about the Accessibility, but can not understand very well. What purpose of contentDescription? And why it appears as warning?

  • 1

    Soen has a reply to your question. Only complementing.

1 answer

4


The contentDescription is used to accessibility, for example with the Talkback, if the user has any visual problems. This label can be used to describe the element. In this case the Warning is for your application to be more accessible even.

If an element is static, do not change, you can put a description. This description will be "read" to the user who has vision problems. It may be that it has little vision, can see the element on the screen but cannot distinguish, if there is this description, Talkback will read (using audio) to the user who will be able to understand what is being displayed.

Widgets non-textual as ImageViews and ImageButtons must use the attribute contentDescription to specify a textual description of widget so that screen readers and other accessibility tools can adequately describe the user interface.

  • 1

    Does this mean that "built" element on the screen for the user I should put a description? And in practice, how exactly is used, considering that the user is blind, as it shows to him that this is an image.?"

  • 1

    If it is an element that does not change, you can put a description. This description will be "read" to the user who has vision problems. It may be that it has little vision, can see the element on the screen but cannot distinguish, if there is this description, Talkback will read (using audio) to the user who will be able to understand what is being displayed.

  • I improved the answer a little more. Thank you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.