Android Common error handling (i)

Source: Internet
Author: User

1, Set android:baselinealigned= "false" on the This element for better performance

If LinearLayout is used for nested layout space calculations, its Android:baselinealigned property should be set to false to speed up the layout calculation


2, this tag and itschildren can replaced by one <TextView/> and a compound drawable

If we want to use a combination of TextView and imageview, we do not need these two components, as long as the TextView use a drawable on the line, such as android:drawabletop= "...."


3, Missing contentdescription attribute on image

The space associated with image needs a description, to solve the problem, add a null character or @string/app_name.


4, thislinearlayout layout or its linearlayout the parent is possibly useless

Nested a sub-linearlayout layout in the LinearLayout layout, and in my entire layout file is the outermost linearlayout to the overall layout of the parent control, causing the layout code to repeat the LinearLayout layout. So just take out the extra linearlayout and get rid of it.


< Span style= "LINE-HEIGHT:19.5PX; margin:0px; padding:0px; Background-color:rgb (254,254,242) "> 5, Nested weights is bad for performance

When the layout is nested, the parent and child layouts use android:layout_weight, but not when they must be used, the warning message shown title appears.

Android Common error handling (i)

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.