Android development problem Accumulation and solution (ii)

Source: Internet
Author: User

Error:"Binary XML file Line #: Error inflating Class"

Cause: This exception is caused by an error in the layout file, so go back to the layout file and look at it.

<?XML version= "1.0" encoding= "Utf-8"?><Relativelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"android:orientation= "vertical" >    <ImageViewAndroid:id= "@+id/disclosureimg"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"android:layout_centervertical= "true"Android:layout_alignparentleft= "true"/>        <TextViewAndroid:id= "@+id/contenttext"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"android:layout_centervertical= "true"Android:layout_torightof= "@id/disclosureimg"/>    </Relativelayout>

There is a yellow exclamation point in the ImageView, the mouse is put up to display "[Accessibility] Missing contentdescription attribute on image", that is, the picture is missing text description .... , find a place to know how to do, the lack of instructions for him to add one.

android:contentdescription= "@string/icon_description"

The problem is solved after adding this attribute, so ... These small details need to pay more attention, try to avoid such a mistake ~

Another: can also refer to this friend's scheme--android runtime exception "Binary XML file Line #: Error inflating Class".

Android development problem Accumulation and solution (ii)

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.