第一二周作业

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <View
        android:id="@+id/S_0"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#5E8ADA"
        android:layout_centerInParent="true"
        />
    <View
        android:id="@+id/S_1"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#3D4B77"
        android:layout_above="@+id/S_0"
        android:layout_toLeftOf="@+id/S_0"
        />
    <View
        android:id="@+id/S_2"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#725EB8"
        android:layout_above="@+id/S_0"
        android:layout_toRightOf="@+id/S_1"
        />
    <View
        android:id="@+id/S_3"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#EBBF77"
        android:layout_above="@+id/S_0"
        android:layout_toRightOf="@+id/S_2"
        />
    <View
        android:id="@+id/S_4"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#E75EDF"
        android:layout_below="@+id/S_1"
        android:layout_toLeftOf="@+id/S_0"
        />
    <View
        android:id="@+id/S_5"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#CF4B66"
        android:layout_below="@+id/S_2"
        android:layout_toRightOf="@+id/S_0"
        />
    <View
        android:id="@+id/S_6"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#379640"
        android:layout_below="@+id/S_0"
        android:layout_centerInParent="true"
        />
    <View
        android:id="@+id/S_7"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#19BB94"
        android:layout_below="@+id/S_0"
        android:layout_toRightOf="@+id/S_6"
        />
    <View
        android:id="@+id/S_8"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#A8D665"
        android:layout_below="@+id/S_0"
        android:layout_toLeftOf="@+id/S_6"
        />



</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android">

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"

    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ffd9ec"
    android:layout_margin="20dp"
    android:orientation="horizontal">

    <View
        android:id="@+id/v_1"
        android:layout_width="match_parent"
        android:layout_height="70dp"
        android:background="#ca8eff"
        android:layout_alignParentTop="true"/>
    <View
        android:id="@+id/v_2"
        android:layout_width="match_parent"
        android:layout_height="70dp"
        android:background="#ca9eff"
        android:layout_alignParentBottom="true"/>

    <View
        android:id="@+id/v_3"
        android:layout_width="80dp"
        android:layout_height="551dp"
        android:layout_below="@+id/v_1"
        android:layout_above="@+id/v_2"
        android:layout_alignParentLeft="true"
        android:background="#a4ffff" />
    <View
        android:id="@+id/v_4"
        android:layout_width="80dp"
        android:layout_height="551dp"
        android:layout_below="@+id/v_1"
        android:layout_above="@+id/v_2"
        android:layout_alignParentRight="true"
        android:background="#c4e1ff" />
</RelativeLayout>

posted @ 2021-08-30 14:57  江美萱  阅读(30)  评论(0)    收藏  举报