将所有的子元素放在整个界面的左上角,后面的子元素直接覆盖前面的子元素,所以用的比较少。
在以后用到碎片的时候用的多,多用于占位
通过代码可以很清楚了解所以就不过多用文字介绍
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"<img src="https://img-blog.youkuaiyun.com/20160918221403210?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" align="right" width="300" height="400" alt="" />
android:layout_height="match_parent"
>
<TextView
android:layout_gravity="center"
android:layout_width="300dp"
android:layout_height="300dp"
android:background="#000000"
/>
<TextView
android:layout_gravity="center"
android:layout_width="200dp"
android:layout_height="200dp"
android:background="#ff0000"
/>
<TextView
android:layout_gravity="center"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#00ff00"
/>
</FrameLayout>