[Accessibility] Missing contentDescription attribute on image


    使用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

http://blog.csdn.net/hn307165411/article/details/7179317


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM