Android Learning Note two-linear Layout

Source: Internet
Author: User

1, LinearLayout is the sub-view is a single-direction, that is, horizontal or vertical orientation of the layout. You can use the Android:orientation property to

Define Layout direction

All sub-view is one next to each other, so a vertical list, no matter how wide it is, can only have one row at a time. If the level list is equal, it will be high.

2, Layoutweight

Used to manipulate the relative proportions of each sub-view, that is, the use of space by individual sub-elements

Weight is not a lot of articles on the internet as described (the article is too one-sided), weight refers to a component in the layout of the "remaining space" in the display weight, then the so-called residual space is what meaning, in fact, is not set weight properties of the control of the first display of the case, Allocate unoccupied layout space to components that have weight set up

       <edittext        android:layout_width= "fill_parent"        android:layout_height= "Wrap_content"        android: layout_weight= "2"        android:background= "#12ed34"        android:hint= "@string/dealtool"/>       <edittext        android:layout_width= "fill_parent"        android:layout_height= "wrap_content"        android:layout_weight= "3"        android:background= "#67bb88"        android:hint= "@string/dealtool"/>       <edittext        android: Layout_width= "Fill_parent"        android:layout_height= "wrap_content"        android:layout_weight= "2"        Android:background= "#00aa00"        android:hint= "@string/hello_world"/>

After the test.

ref:http://blog.csdn.net/frank_softworks/article/details/7320268

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.