Android Learning notes (1)

Source: Internet
Author: User

Fill_parent, wrap_content, match_parent usage Example test

Fill_parent set a top layout or control to make it full of screens.

Wrap_content layouts are automatically scaled to fit the contents of the view (just to support the size of their content)

Android2.2 after fill_parent replaced by Match_parent.

Note:Beginning with Android 2.2 (API level 8),"fill_parent"has been renamed"match_parent"To better reflect the behavior. The reason is so if you set a view to "fill_parent" It does expand to fill the remaining space after sibling views is considered, but instead expands to match the size of the parent view no matter what-it would overlap any sibling views.

<button         android:layout_width= "wrap_content"        android:layout_height= "wrap_content"        android:text= " @string/button_send "  />

<button         android:layout_width= "match_parent"        android:layout_height= "wrap_content"        android:text= " @string/button_send "  />

<button         android:layout_width= "wrap_content"        android:layout_height= "match_parent"        android:text= " @string/button_send "  />

<button         android:layout_width= "match_parent"        android:layout_height= "match_parent"        android:text= "@string/button_send"  />

ref:http://blog.csdn.net/jumping_android/article/details/7397991

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.