12. FrameLayout 帧布局

12. FrameLayout 帧布局

12.1 演示
<?xml version="1.0" encoding="utf-8"?>

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

    <FrameLayout
        android:background="#ff0000"
        android:layout_width="400dp"
        android:layout_height="400dp"/>

    <FrameLayout
        android:background="#ffff00"
        android:layout_width="300dp"
        android:layout_height="300dp"/>


</FrameLayout>

在这里插入图片描述

帧布局从左上角开始绘制,红色过了黄色

一个一个往上堆

在这里插入图片描述

12.2 常见属性
属性 含义
foreground 设置前景
foregroundGravity 设置前景位置

在这里插入图片描述

posted @ 2022-09-12 16:55  随遇而安==  阅读(17)  评论(0编辑  收藏  举报