Fork me on GitHub

Android第一次作业

 

 

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:id="@+id/ll_1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFFF">
    <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="#4CAF50"
        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="#FFEB3B"
        android:layout_above="@id/V_1"
        android:layout_toRightOf="@id/V_2"/>
    <View
        android:id="@+id/V_4"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#ABCDEF"
        android:layout_above="@id/V_1"
        android:layout_toRightOf="@id/V_3"/>
    <View
        android:id="@+id/V_5"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#2196F3"
        android:layout_below="@id/V_2"
        android:layout_toLeftOf="@id/V_1"/>
    <View
        android:id="@+id/V_6"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#FF5722"
        android:layout_below="@id/V_4"
        android:layout_toRightOf="@id/V_1"/>
    <View
        android:id="@+id/V_7"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#673AB7"
        android:layout_below="@id/V_5"
        android:layout_toLeftOf="@id/V_1"/>
    <View
        android:id="@+id/V_8"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#00BCD4"
        android:layout_below="@id/V_1"
        android:layout_toRightOf="@id/V_7"/>
    <View
        android:id="@+id/V_9"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#4CAF50"
        android:layout_below="@id/V_1"
        android:layout_toRightOf="@id/V_8"/>


</RelativeLayout>

  

 

 

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:id="@+id/ll_1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FAFAFA"
    android:layout_margin="20dp"
    android:orientation="horizontal">
    <View
        android:id="@+id/V_1"
        android:layout_width="match_parent"
        android:layout_height="75dp"
        android:background="#03A9F4"
        android:layout_alignParentTop="true"/>
    <View
        android:id="@+id/V_2"
        android:layout_width="match_parent"
        android:layout_height="75dp"
        android:background="#03A9F4"
        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:background="#FFEB3B"
        android:layout_alignParentLeft="true"/>

    <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:background="#FFEB3B"
        android:layout_alignParentRight="true"/>
    


</RelativeLayout>

  

 

 

 

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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=".MainActivity"
    android:orientation="vertical">


    <ImageView
        android:id="@+id/Tu_1"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:background="@drawable/user"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="200dp"/>
    <TextView
        android:id="@+id/tv_1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="用户"
        android:textSize="24sp"
        android:textColor="#000000"
        android:layout_margin="10dp"
        android:layout_centerVertical="true"
        android:padding="10dp"/>
    <TextView
        android:id="@+id/tv_2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="密码"
        android:textSize="24sp"
        android:textColor="#000000"
        android:layout_margin="10dp"
        android:layout_centerVertical="true"
        android:padding="10dp"
        android:layout_below="@id/tv_1"/>
    <EditText
        android:id="@+id/et_1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:hint="请输入账号"
        android:textColor="#000000"
        android:textSize="24sp"
        android:layout_margin="10dp"
        android:padding="10dp"
        android:layout_toRightOf="@id/tv_1"
        android:drawablePadding="10dp"/>
    <EditText
        android:id="@+id/et_2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/tv_1"
        android:layout_centerVertical="true"
        android:hint="请输入密码"
        android:textColor="#000000"
        android:textSize="24sp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:padding="10dp"
        android:layout_toRightOf="@id/tv_1"
        android:drawablePadding="10dp"/>
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/et_2"
        android:layout_centerHorizontal="true"
        android:layout_margin="20dp"
        android:padding="10dp"
        android:background="#03A9F4"
        android:text="登录"
        android:textSize="24sp"/>
</RelativeLayout>

  

 

posted @ 2021-08-28 23:26  Y6  阅读(68)  评论(0)    收藏  举报