文章出處

1.報錯信息:
[Accessibility] Missing contentDescription attribute on image

詳細信息:
Explanation: Image without contentDescription 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. Note that elements in application screens that are purely decorative and do not provide any content or enable a user action should not have accessibility content descriptions. In this case, just suppress the lint warning with a tools:ignore=”ContentDescription” attribute. Note that for text fields, you should not set both the hint and the contentDescription attributes since the hint will never be shown. Just set the hint. See http://developer.android.com/guide/topics/ui/accessibility/checklist.html.
解釋:
在一些沒有文本顯示的控件里,如imageView和imageButton等,ADT會提示你定義一個android:contentDescription屬性,用來描述這個控件的作用。

2.報錯信息:This tag and its children can be replaced by one and a compound drawable
解決如下:
前:

后:

3.報錯信息:Hardcoded string “計算器”, should use @string resource
解決:將xml布局中直接使用的字符串在string資源文件中設置,在xml中進行引用即可。

看文倉www.92to.com網友整理上傳,為您提供最全的知識大全,期待您的分享,轉載請注明出處。
歡迎轉載:http://www.kanwencang.com/bangong/20161220/74659.html

文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()