发现问题:
今天学习时,用 ImageView插入一张图片,出现了 [Accessibility] Missing contentDescription attribute on image 警告,R.java文件也不自动更新了,导致我的项目无法运行。
解决办法:
在查阅官方文档与网上大家的方法后,在代码中加入 android:contentDescription="@string/ic_user" 属性,然后在 string.xml文件中添加ic_user的值,问题解决。
目的:
为了图片组件也能有个文本描述。
不想设置可以写 android:contentDescription="@null"