Missing contentDescription attribute on image

    android開發中在配置文件中使用ImageView有時會引起Missing contentDescription attribute on image.比如:在main.xml中增加ImageView控件時如果沒有加android:contentDescription=”@string/app_name”時會引起Missing contentDescription attribute on image.

    主要是因爲在main.xml中沒有使用TextView之類的文本控件,ADT會提示給像ImageView增加一個說明,這裏添加android:contentDescription=”@string/app_name即可,其實加不加影響不大。只是在IDE中會顯示一個黃色下劃線,不美觀。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章