Android studio第1、2周作业

作业1:安装环境,截图编程界面,截图运行界面

作业2:九宫格

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

    <LinearLayout
        android:id="@+id/ll_1"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:background="#ECECEC"
        android:orientation="horizontal">

        <View
            android:id="@+id/v_1"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#8C192F" />

        <View
            android:id="@+id/v_2"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#FFFdf0" />

        <View
            android:id="@+id/v_3"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#115DFF" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/ll_2"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:background="#EB3223"
        tools:ignore="DuplicateIds">

        <View
            android:id="@+id/v_4"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#0E5D2D" />

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

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

    <LinearLayout
        android:id="@+id/ll_3"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:background="#C206EE"
        tools:ignore="DuplicateIds">

        <View
            android:id="@+id/v_7"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#0AF00A" />

        <View
            android:id="@+id/v_8"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#FFFF00" />

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

</LinearLayout>

 

 

作业3:布局界面(QQ群截图)

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

    <TextView
        android:id="@+id/v_2"
        android:layout_width="match_parent"
        android:layout_height="90dp"
        android:background="#002AFF"></TextView>

    <RelativeLayout
        android:id="@+id/v_3"
        android:layout_width="match_parent"
        android:layout_height="560dp"
        android:layout_below="@id/v_2"
        android:background="#FFFFFF">

        <RelativeLayout
            android:id="@+id/v_5"
            android:layout_width="100dp"
            android:layout_height="match_parent"
            android:background="#D7DF01"></RelativeLayout>

        <RelativeLayout
            android:id="@+id/v_6"
            android:layout_width="80dp"
            android:layout_height="match_parent"
            android:layout_alignParentRight="true"
            android:background="#FFC0CB">

        </RelativeLayout>
    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/v_4"
        android:layout_width="match_parent"
        android:layout_height="90dp"
        android:layout_alignBottom="@id/v_3"
        android:background="#EE82EE"></RelativeLayout>
</RelativeLayout>

 

 

<?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="#e6e6e6">

    <ImageView
        android:id="@+id/T_1"
        android:layout_width="200dp"
        android:layout_height="200dp"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="50dp"
        android:src="@drawable/j" />


    <LinearLayout
        android:id="@+id/id"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/T_1"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="50dp"
        android:layout_marginRight="10dp"
        android:orientation="horizontal">


        <TextView
            android:id="@+id/id_1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#ffffff"
            android:text="账号:"
            android:textSize="50sp" />


        <EditText
            android:id="@+id/id_2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@null"
            android:hint="请输入账号"
            android:maxLines="1"
            android:textSize="40sp" />

    </LinearLayout>

    <LinearLayout
        android:id="@+id/pass"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/id"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="10dp"
        android:layout_marginRight="10dp">

        <TextView
            android:id="@+id/pass_1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#ffffff"
            android:text="密码:"
            android:textSize="50sp" />

        <EditText
            android:id="@+id/pass_2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@null"
            android:hint="请输入密码"
            android:maxLines="1"
            android:textSize="40sp" />
    </LinearLayout>

    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/pass"
        android:layout_marginLeft="20dp"
        android:layout_marginTop="50dp"
        android:layout_marginRight="20dp"
        android:background="#FFFFFF"
        android:text="登录"
        android:textSize="40sp" />

</RelativeLayout>

 

 

posted @ 2021-10-09 16:57  辛事成  阅读(131)  评论(0编辑  收藏  举报