android - 图像浏览错误
问题描述
图像上缺少 contentDescription 属性 像 ImageViews 和 ImageButtons 这样的非文本小部件应该使用 contentDescription 属性来指定小部件的文本描述,以便屏幕阅读器和其他辅助工具可以充分描述用户界面。请注意,应用程序屏幕中纯装饰性且不提供任何内容或启用用户操作的元素不应具有可访问性内容描述。在这种情况下,只需使用工具抑制 lint 警告,忽略“ContentDescription”属性。请注意,对于文本字段,您不应同时设置提示和 contentDescription 属性,因为提示永远不会显示。只需设置提示。看
解决方案
在 imageview /imagebutton 的布局中添加 contentDescription="some text" 不要在这些视图中添加提示。contentDescription 和 hint 不应在同一视图中检查布局的 xml。
推荐阅读
- python - Python 硒点击()
- python - 找不到 Django:/virtual/Scripts/dashApp/static/main.css
- windows - 由于“程序文件”文件夹名称之间的空格,Matlab 给出错误
- c# - 避免将 excel 数据粘贴到 DataGridView 标题中
- swift - 无论如何,我是否可以在 Swift 中使用 MFMessageComposeViewController() 通过文本发送 PDF 和 PNG?
- javascript - 打字稿:如何注释一个类(而不是类实例)的类型?
- android - 一对 Android 设备之间的 ZeroMQ PUB/SUB 仅适用于 .connect(),.bind() 到目前为止似乎失败了
- javascript - 将鼠标悬停在 div“矩形”上不起作用
- python - 使用 pip 安装 syslog-py 时出现 SSL 错误
- javascript - Chart.js:除非 x 轴具有完全相同的值,否则无法获取 x 轴值的坐标