Android Lint contentDescription warning

后端 未结 11 1758
情书的邮戳
情书的邮戳 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:59

    Resolved this warning by setting attribute android:contentDescription for my ImageView

    android:contentDescription="@string/desc"
    

    Android Lint support in ADT 16 throws this warning to ensure that image widgets provide a contentDescription.

    This defines text that briefly describes content of the view. This property is used primarily for accessibility. Since some views do not have textual representation this attribute can be used for providing such.

    Non-textual widgets like ImageViews and ImageButtons should use the contentDescription attribute to specify a textual description of the widget such that screen readers and other accessibility tools can adequately describe the user interface.

提交回复
热议问题