Android--framelayout layout

Source: Internet
Author: User

Frame layouts are the simplest way to lay out, and all views added to this layout are displayed in a cascading manner, with the first view added to the layout displayed at the bottom, the last one placed on top, and the previous view covering the next layer of view. The framework is similar to a stack layout. By default, components are placed in the upper-left corner.

One, copy several pictures to the/RES/DRAWABLE-HPDI directory

<framelayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http// Schemas.android.com/tools "android:layout_width=" match_parent "android:layout_height=" Match_parent "Android:paddi ngbottom= "@dimen/activity_vertical_margin" android:paddingleft= "@dimen/activity_horizontal_margin" Android: paddingright= "@dimen/activity_horizontal_margin" android:paddingtop= "@dimen/activity_vertical_margin" tools: Context= ". Mainactivity "><imageview android:layout_width=" match_parent "android:layout_height=" Wrap_content "Android: layout_gravity= "center" android:background= "@drawable/bg"/><imageview android:layout_width= "63DP" Android: layout_height= "46DP" android:layout_gravity= "center" android:layout_margintop= "80DP" android:background= "@drawabl E/girl "/><imageview android:layout_width=" 100DP "android:layout_height=" 100DP "android:layout_gravity=" cen ter "android:layout_marginbottom=" 80DP "android:background= "@drawable/test"/></framelayout> 

You can see the first picture in turn BG because in the use ofThe layout_gravity property, so the mid-level display

the second picture of Girl is not set to alignment, so the default in the upper left corner, the third picture test is aligned to the middle, but because of the extra Layout_marginbottom, on the distance, the content is 80DP.


Android--framelayout layout

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.