ImageView appears warning [accessibility]missing contentdescription attribute on image

Source: Internet
Author: User

Today, when you add the ImageView component in the authoring Android layout file, the warning pops up, prompting:

[Accessibility] Missing contentdescription attribute on image

It was strange at the time, when to add the picture related components need to set this property?

And then you find the next solution, one is lazy method, one is more official method

One, lazy method------This type of warning is set to ignore by default

First step: windows-->preferences

650) this.width=650; "src=" http://s16.sinaimg.cn/mw690/71f9299cgd6d78ba8434f&690 "width=" 273 "height=" 392 "name = "image_operate_79611362121605896" alt= "ImageView appears warning [accessibility]missing <wbr>contentdescription <wbr >attribute <wbr>on <wbr>imag "title=" ImageView appears warning [accessibility]missing <wbr> ContentDescription <wbr>attribute <wbr>on <wbr>imag "style=" margin:0px;padding:0px;border:0px; List-style:none; "/>

Step Two:

650) this.width=650; "src=" http://s4.sinaimg.cn/mw690/71f9299cgd6d79ac0b3f3&690 "width=" 690 "height=" 672 "name= "image_operate_6191362121976303" alt= "ImageView appears warning [accessibility]missing <wbr>contentdescription <wbr >attribute <wbr>on <wbr>imag "title=" ImageView appears warning [accessibility]missing <wbr> ContentDescription <wbr>attribute <wbr>on <wbr>imag "style=" margin:0px;padding:0px;border:0px; List-style:none; "/>

Although method one can get rid of that abrupt warning, but for me, appear warning and take this kind of neglect method to solve, after all, the heart still will remain a lump, that there are other better solutions? Refer to Method Two.

Ii. More Official methods

In addition to this warning from the ImageView component, this warning is also likely to occur with ImageButton. At this point we can add a property under the component-----android:contentdescription= "@string/desc" and then add the text description of the picture to the string. The XML document.

The function is to ensure that the picture component can provide a textual description.


This article is from the "No Water Fish" blog, please be sure to keep this source http://javaqun.blog.51cto.com/10687700/1705522

ImageView appears warning [accessibility]missing contentdescription attribute on image

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.