使用Eclipse定義一個ImageVIew的時候 總是提示這個[Accessibility] Missing contentDescription attribute on image警告,雖說可以不理 但總是感覺怪怪的,在網上一搜 發現原來這是ADT 16.0(我使用的是ADT20.0)的新特性,在一些沒有文本顯示的控件里,如imageView和imageButton等,ADT會提示你定義一個android:contentDescription屬性,用來描述這個控件的作用。英文原文如下:
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.
相關鏈接:
http://stackoverflow.com/questions/8500544/android-lint-contentdescription-warning