android--How to understand the difference between the width of the control and the Layout_grivaty and the Grivaty

Source: Internet
Author: User

Thinking about the wide-height caused by layout_width/height

Way One:




The results do not meet expectations.

Operation Result:



Way two:



The results are in line with expectations.

Such as:



the rules for Android control's height :

The controls under Android are not wide by default, and are given a wide height by the parent control.

The general view control is made up of five layouts (ViewGroup control: LinearLayout, Relativelayout, Tablelayout, Framelayout, absolutelayou) to its wide height.

The height of the outermost layout controls, such as LinearLayout, Relativelayout, and so on, is set by the Framelayout control of the Android system. Hierarchyviewer.bat can be viewed under Android-sdk/tools tools, such as:


for the modification scheme of mode one , the following code:



The results of the operation are as follows:



Layout_grivaty and Grivaty


Layout_grivaty points to note when using:


Results such as:




Results such as:



Difference:






android--How to understand the difference between the width of the control and the Layout_grivaty and the Grivaty

Related Article

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.