Android:contentdescription is not useless.

Source: Internet
Author: User

When writing an XML layout file for Android, you often encounter a hint in ImageView or ImageButton: Missing contentdescription attribute on image.

in the Android Picture Display class control, does not write android:contentdescription often has the warning (Eclipse development), this property is convenient for some physiological function defective person to use the application, For example, some visually impaired users, if the user installed a secondary browsing tools such as TalkBack,TalkBack will read aloud the user is currently browsing content. The TextView control talkback can read the contents (ContentDescription values) directly, telling the user what the picture is.


Use of talkback:

Android:contentdescription This property must be enabled in the user's accessible when the corresponding property is turned on.

1. First download Google apps TalkBack (an accessibility service published by Google) and turn features on Settings > Accessibility > TalkBack Set to ON.

2. Add this attribute to the app.

< Button       Android:id = "@+id/pause_button"       android:src = "@drawable/pause"       android:contentdescription

3. The user clicks on this control. The Android system automatically uses the vocals to read the contents of the Android:contentdescription property on the control.

The main function of this property is to increase the interpretation of the control for those with impaired eyesight.

Of course, when you don't want to use this property,

android:contentdescription= "@null"

Can!

Same

Android:background= "@null"

Can remove the ImageButton ugly background

Reference: http://blog.csdn.net/yuxiaohui78/article/details/41206179

Android:contentdescription is not useless.

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.