[Android development] frame layout

<?xml version="1.0" encoding="utf-8"?>
<!--android:foreground 无条件处于最上层-->
<!--android:foreground="right|bottom"-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#cccccc"
    android:foreground="@mipmap/ic_launcher"
    android:foregroundGravity="center">

    <TextView
        android:layout_width="400dp"
        android:layout_height="400dp"
        android:background="#ff0000"
        android:layout_gravity="center"/>

    <TextView
        android:layout_width="350dp"
        android:layout_height="350dp"
        android:background="#00ff00"
        android:layout_gravity="center"/>

    <TextView
        android:layout_width="300dp"
        android:layout_height="300dp"
        android:background="#0000ff"
        android:layout_gravity="center"/>

</FrameLayout>

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_42020386/article/details/112784420