FrameLayout布局就是在屏幕上开辟一个区域以填充所有的组件,但是使用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" tools:context=".MainActivity" > <TextView android:id="@+id/text1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="我的框架布局管理器"/> <Button android:id="@+id/mybutton1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="我的框架布局管理器按钮"/> <EditText android:id="@+id/myedit1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="输入姓名"/> </FrameLayout>