第一次作业

1.

2.

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

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/rl_1"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <View
        android:id="@+id/v_1"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#000000"
        android:layout_centerInParent="true"/>
    <View
        android:id="@+id/v_2"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#0EDB16"
        android:layout_above="@id/v_1"
        android:layout_toLeftOf="@id/v_1"
        />
    <View
        android:id="@+id/v_3"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#F80505"
        android:layout_above="@id/v_1"
        android:layout_toRightOf="@id/v_1"/>
    <View
        android:id="@+id/v_4"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#028FFA"
        android:layout_below="@id/v_1"
        android:layout_toRightOf="@id/v_1"/>
 
    <View
        android:id="@+id/v_5"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#D709FC"
        android:layout_below="@id/v_1"
        android:layout_toLeftOf="@id/v_1"/>
    <View
        android:id="@+id/v_6"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#FCE103"
        android:layout_below="@id/v_2"
        android:layout_toLeftOf="@id/v_1"/>
    <View
        android:id="@+id/v_7"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#03DAF8"
        android:layout_below="@id/v_1"
        android:layout_toLeftOf="@id/v_4"/>
    <View
        android:id="@+id/v_8"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#5600F3"
        android:layout_below="@id/v_2"
        android:layout_toRightOf="@id/v_1"/>
    <View
        android:id="@+id/v_9"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#09F1D7"
        android:layout_above="@id/v_1"
        android:layout_toRightOf="@id/v_2"/>
</RelativeLayout>
3.

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

<ImageView
android:id="@+id/v_0"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="@drawable/haokandetupian"
android:layout_centerHorizontal="true"
android:layout_marginTop="150dp" />

<EditText
android:id="@+id/v_1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:hint="用户名"
android:background="@drawable/btn_2"
android:layout_marginTop="20dp"
android:layout_marginHorizontal="10dp"
android:padding="10dp"
android:drawableLeft="@drawable/zhanghao"
android:drawablePadding="10dp"
android:layout_below="@id/v_0"/>

<EditText
android:id="@+id/v_2"
android:layout_width="match_parent"
android:layout_height="50dp"
android:hint="密码"
android:background="@drawable/btn_2"
android:layout_margin="10dp"
android:padding="10dp"
android:drawableLeft="@drawable/mima"
android:drawablePadding="10dp"
android:layout_below="@id/v_1"/>

<Button
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="100dp"
android:text="登录"
android:layout_margin="40dp"
android:background="@drawable/btn_1"
android:layout_below="@id/v_2"/>

</RelativeLayout>

posted @ 2021-08-25 23:14  李芊  阅读(52)  评论(0编辑  收藏  举报