我在eclipse中收到一个警告,提示[可访问性]图像缺少contentDescription属性。该警告出现在以下XML代码的第5行(声明ImageView
)。
当构建和运行我的应用程序时,这不会产生任何错误。但我真的很想知道为什么会收到这个警告。
这是我的XML文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/contact_entry_image"
android:src="@drawable/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/contact_entry_text"
android:text=""
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="30sp"
/>
</LinearLayout>
请帮我处理这个问题,感谢您的阅读。
ImageView
中添加android:contentDescription
属性,这只是一个建议,你可以忽略它,它不会导致编译错误。你也可以查看http://developer.android.com/reference/android/view/View.html#attr_android:contentDescription
。 - idiottiger