FrameLayout-帧布局
实现效果:
代码:
<?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" > <TextView android:layout_width="300dp"
android:layout_height="300dp"
android:layout_gravity="center"
android:background="#ff0000"/> <TextView android:layout_width="250dp"
android:layout_height="250dp"
android:layout_gravity="center"
android:background="#00ff00"/> <TextView android:layout_width="200dp"
android:layout_height="200dp"
android:layout_gravity="center"
android:background="#0000ff"/> <TextView android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="center"
android:background="#ffff00"/> <TextView android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:background="#ffc0cb"/> <TextView android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:background="#f8f8ff"/> </FrameLayout>