Android第一次作业

作业一

作业二


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="300dp" android:layout_height="300dp" android:background="#4AC23D" android:layout_margin="50dp" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:background="#DF2727" android:layout_weight="1" android:orientation="horizontal"> <View android:id="@+id/s_1" android:layout_width="0dp" android:layout_height="match_parent" android:background="#B552E9" android:layout_weight="1"/> <View android:id="@+id/s_2" android:layout_width="0dp" android:layout_height="match_parent" android:background="#DBDB9E" android:layout_weight="1"/> <View android:id="@+id/s_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/s_4" android:layout_width="0dp" android:layout_height="match_parent" android:background="#0E0D0D" android:layout_weight="1"/> <View android:id="@+id/s_5" android:layout_width="0dp" android:layout_height="match_parent" android:background="#E91DC6" android:layout_weight="1"/> <View android:id="@+id/s_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/s_7" android:layout_width="0dp" android:layout_height="match_parent" android:background="#0AF00A" android:layout_weight="1"/> <View android:id="@+id/s_8" android:layout_width="0dp" android:layout_height="match_parent" android:background="#FFFF00" android:layout_weight="1"/> <View android:id="@+id/s_9" android:layout_width="0dp" android:layout_height="match_parent" android:background="#115DFC" android:layout_weight="1

 作业三

<?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="#8B06F0DE"/>

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

        <View
            android:layout_width="250dp"
            android:layout_height="match_parent"
            android:background="#97381A3D"
            android:layout_centerHorizontal="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:id="@+id/r_1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
tools:context=".MainActivity"
android:orientation="vertical">
<TextView
android:id="@+id/tv_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="用户"
android:textSize="24sp"
android:layout_margin="10dp"
android:padding="10dp"
android:layout_centerVertical="true"/>
<TextView
android:id="@+id/tv_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="密码"
android:textSize="24sp"
android:layout_margin="10dp"
android:padding="10dp"
android:layout_below="@id/tv_1"
android:layout_centerVertical="true"/>
<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:drawableLeft="@drawable/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_2"
android:drawableLeft="@drawable/tv_1"
android:drawablePadding="10dp"
android:inputType="textPassword"/>

<Button
android:layout_width="163dp"
android:layout_height="wrap_content"
android:layout_below="@id/et_2"
android:layout_centerHorizontal="true"
android:layout_marginStart="40dp"
android:layout_marginLeft="40dp"
android:layout_marginTop="40dp"
android:layout_marginEnd="40dp"
android:layout_marginRight="40dp"
android:layout_marginBottom="40dp"
android:background="#FFD180"
android:padding="20dp"
android:text="登录"
android:textSize="20dp" />
<ImageView
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_above="@id/et_1"
android:layout_centerInParent="true"
android:layout_marginBottom="30dp"
android:src="@drawable/user"/>

 

</RelativeLayout>

  

posted @ 2021-08-23 12:03  宋驰  阅读(32)  评论(0编辑  收藏  举报