One of Android five layout frame layouts (framelayout)

Source: Internet
Author: User

I. Framelayout (frame layout) Focus:

Framelayout (frame layout) can be said to be the simplest of the five layouts, this layout will default to the control on the screen in the upper-left corner of the area, the subsequent addition of the control will overwrite the previous one, if the size of the control is as large, then the same moment can only see the top of the control

Two. Framelayout (frame layout) Common properties:

Android:foreground: Setting the foreground image of a frame-changing layout container
Android:foregroundgravity: Setting the location of the foreground image display

Three. Example:

1. First create a framelayout XML file

The code is as follows:

1 <?XML version= "1.0" encoding= "Utf-8"?>2 <Framelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"3 Android:layout_width= "Match_parent"4 Android:layout_height= "Match_parent" >5     6     <TextView7         Android:layout_width= "200DP"    8 Android:layout_height= "200DP"    9 Android:background= "#FF0000" />    Ten     <TextView One         Android:layout_width= "150DP"     A Android:layout_height= "150DP"     - Android:background= "#00FFFF" />     -      <TextView the         Android:layout_width= "100DP"     - Android:layout_height= "100DP"     - Android:background= "#FFFF00" /> -  + </Framelayout>

The results of the operation are as follows:

The above is my understanding of framelayout (frame layout)

One of Android five layout frame layouts (framelayout)

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.