FrameLayout
该布局管理器为x轴正向,y轴负向分布 按布局先后顺序,后者覆盖前者。
FrameLayout内有一个特殊的标签
android:foreground=""
该标签可以设置前景图像,且该图像不会被内部布局覆盖
另外可以通过foregroundGravity标签修改前景图像的位置
android:foregroundGravity="left|top"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:foreground="@drawable/icon_collectioned_2x"
android:foregroundGravity="left|top"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="aaaaaaaaaaaaaaaaaaaaaaa"
android:background="#FFF000"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="aaaaaaaaaaaaaaaaa"
android:background="#FF0000"
/>
</FrameLayout>