2013年3月23日 星期六

[Android][Layout][Accessibility] Missing contentDescription attribute on image

使用程式:Eclipse

SDK版本:API 16.0

錯誤 / 警告訊息:[Accessibility] Missing contentDescription attribute on image


錯誤 / 警告原因:這是在ADT 16.0新增加的,在一些沒有標題顯示的控制裡(如imageView和imageButton等),就會提示你定義一個android:contentDescription屬性,用來描述這個控件的作用。

解決方法:

1.我們只要在 XML 裡面增加 android:contentDescription 的屬性即可。

我是使用 "@string/app_name" 反正只是描述沒差

沒有留言:

張貼留言