[Accessibility] Missing contentDescription attribute on image

今天使用了下ADT 16.0 在定义一个ImageVIew的时候 总是提示这个 [Accessibility] Missing contentDescription attribute on image警告,虽说可以不理 但总是感觉怪怪的,在网上一搜 发现原来这是ADT 16.0的新特性,在一些没有文本显示的控件里,如imageView和imageButton等,ADT会提示你定义一个android:contentDescription属性,用来描述这个控件的作用。英文原文如下,如有翻译的不对的地方,敬请批评指正。

Resolved this warning by setting attribute android:contentDescription for my ImageView

android:contentDescription="@string/desc"

Android Lint support in ADT 16 throws this warning to ensure that image widgets provide a contentDescription

This defines text that briefly describes content of the view. This property is used primarily for accessibility. Since some views do not have textual representation this attribute can be used for providing such.

Non-textual widgets like ImageViews and ImageButtons should use the contentDescription attribute to specify a textual description of the widget such that screen readers and other accessibility tools can adequately describe the user interface.


原文链接:http://stackoverflow.com/questions/8500544/android-lint-contentdescription-warning

http://blog.csdn.net/hn307165411/article/details/7179317
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
问题中的错误信息是"E AttributeError: type object 'By' has no attribute 'ACCESSIBILITY_ID'"。 根据引用的源码改动,我们可以看到,在最新的WebDriver库中,By模块的访问性ID属性已被移除。因此,如果您在代码中尝试使用By.ACCESSIBILITY_ID,就会报错。 为了解决这个问题,您可以使用其他可用的定位策略来代替访问性ID。您可以尝试使用其他定位方法,如By.ID、By.NAME、By.XPATH、By.CSS_SELECTOR等。具体使用哪种方法取决于您的需求和页面结构。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Pywinauto 应用后端类型选择错误:AttributeError: ‘NoneType‘ object has no attribute ‘backend‘....](https://blog.csdn.net/qq_38161040/article/details/100882561)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_id](https://blog.csdn.net/weixin_44745809/article/details/125913755)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值