帧布局基础

阅读 31

2022-04-18

<?xml version="1.0" encoding="utf-8"?>
<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"
    tools:context=".FrameActivity"
    android:foreground="@mipmap/naruto"
    android:foregroundGravity="center">

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

    </TextView>

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

    </TextView>

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

    </TextView>

    <TextView
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#ff00ff"
        android:layout_gravity="center">

    </TextView>
</FrameLayout>

 

 

精彩评论(0)

0 0 举报