FrameLayout布局:

单帧布局在新定义组件的时候永远会将组件放置在屏幕的左上角,即使在此布局中定义多个组件,后一个组件总会将前一个组件所覆盖,除非后一个组件是透明的。

代码如下:

<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"

     >

<Button

    android:layout_width="fill_parent"

    android:layout_height="wrap_content"

    android:text="button1"

    />

<Button

    android:layout_width="wrap_content"

    android:layout_height="fill_parent"

    android:text="button2"

    />

<Button

    android:layout_width="wrap_content"

    android:layout_height="wrap_content"

    android:text="button3"

    />


</FrameLayout>

运行如下:

android基础之FrameLayout布局