LWM

作业

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="300dp"
    android:layout_height="300dp"
    android:background="#C23D3D"
    android:layout_margin="50dp"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="#EEECEC"
        android:layout_weight="1"
        android:orientation="horizontal">

        <View
            android:id="@+id/v_1"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:background="#0AF00A"
            android:layout_weight="1"/>
        <View
            android:id="@+id/v_2"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:background="#FFFF00"
            android:layout_weight="1"/>
        <View
            android:id="@+id/v_3"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:background="#115DFC"
            android:layout_weight="1"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="#EB2323"
        android:layout_weight="1">

        <View
            android:id="@+id/v_4"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:background="#0E0D0D"
            android:layout_weight="1"/>
        <View
            android:id="@+id/v_5"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:background="#E91DC6"
            android:layout_weight="1"/>
        <View
            android:id="@+id/v_6"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:background="#EEE5CC"
            android:layout_weight="1"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="#C206EE"
        android:layout_weight="1">

        <View
            android:id="@+id/v_7"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:background="#0AF00A"
            android:layout_weight="1"/>
        <View
            android:id="@+id/v_8"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:background="#FFFF00"
            android:layout_weight="1"/>
        <View
            android:id="@+id/v_9"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:background="#115DFC"
            android:layout_weight="1"/>
    </LinearLayout>

</LinearLayout>

 

练习

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/q1"
    android:layout_height="match_parent"
    android:layout_width="match_parent">

    <View
        android:id="@+id/v_1"
        android:layout_width="match_parent"
        android:layout_height="150dp"
        android:background="#06F0DE"/>

    <RelativeLayout
        android:id="@+id/v_2"
        android:layout_width="match_parent"
        android:layout_height="500dp"
        android:background="#DB8C8C"
        android:layout_centerInParent="true">

        <View
            android:layout_width="250dp"
            android:layout_height="match_parent"
            android:background="#BBF07D"
            android:layout_centerHorizontal="true"/>
</RelativeLayout>

    <View
        android:id="@+id/v_3"
        android:layout_width="match_parent"
        android:layout_height="150dp"
        android:background="#06F0DE"
        android:layout_below="@id/v_2"/>

</RelativeLayout>

 

posted on 2021-08-19 15:14  Lwmm  阅读(48)  评论(0编辑  收藏  举报