Android Lint contentDescription warning

后端 未结 11 1766
情书的邮戳
情书的邮戳 2020-12-07 17:03

I am getting warning as \"[Accessibility] Missing contentDescription attribute on image\" for imageview. while using android lint

What does that mean?

11条回答
  •  忘掉有多难
    2020-12-07 17:43

    I recommend you to add the contentDescription.

    android:contentDescription="@string/contentDescriptionXxxx"
    

    but, let's be realistic. Most people don't maintain literal for accessibility. Still, with little effort, you can implement something to help people with disability.

    deco
    button de action
    image with data
    image from an other user
    

    .

    The most important thing the blind user will need to know is "Where is the button that I need to click to continue"

    Use contentDescriptionAction for anything clickable.

    use contentDescriptionContent for image with information (graph, textAsImage, ...)

    use contentDescriptionUserContent for all user provided content.

    use contentDescriptionUseless for all the rest.

提交回复
热议问题