Article 4 common attributes of layout and controls 1. Attributes of layout controls

Source: Internet
Author: User

Article 4 common attributes of layout and controls 1. Attributes of layout controls

Attributes that are easy to understand will not be explained. Here we will look at some attributes that are not very clear ~~

 

Layout_margin

The distance between the View/control and the parent View margin. The value can be a negative number.

 

Layout_padding

The content of the control or view and its own margin (internal margin). The top, bottom, left, and right padding refer to the distance between the text in the button and the button border. The default value is 0, and cannot be negative.

 

 

 

Layout_gravity and gravity

Attribute Value: wrap_content and match_parent

 

Fill_parentThis attribute is changed to match_parent during api level 8 due to the misunderstanding of the name. Currently, the majority of development projects are later than 4.0, so match_parent is used.

Although we can directly specify the width and height of the control, we recommend that you use the wrap_content and match_parent attributes because the screen size of the device cannot be determined.

 

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.