我收到有关 Eclipse 中图像上的 [Accessibility]Missing 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>
请帮助我解决这个问题,并感谢您的阅读。
原文由 PhatHV 发布,翻译遵循 CC BY-SA 4.0 许可协议
按照此链接获取解决方案: Android Lint contentDescription 警告
此链接用于解释: 可访问性、它的影响和开发资源
本指南旨在使您的应用程序易于访问: 使应用程序更易于访问