帧布局特点:
所有的子元素都不能被指定放置的位置,他们都被放在顶级区域的左上角,
并且后面的子元素直接覆盖在前面的子元素之上,将前面的子元素部分和全部遮挡。
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/FrameLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_gravity="center"
android:background="#2196F3" />
<TextView
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="center"
android:background="#FFEB3B" />
<TextView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:background="#F44336" />
</FrameLayout>