Android第一次作业

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

 

 作业2:九宫格

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    android:background="#000000"
    android:layout_margin="20dp"
    android:orientation="vertical">

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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="#FFFFFF"
        android:layout_weight="4">
        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:background="#F44336"
            android:layout_weight="1"/>
        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:background="#FFEB3B"
            android:layout_weight="4"/>
        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:background="#F44336"
            android:layout_weight="1"/>

    </LinearLayout>

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

</LinearLayout>

 

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

<?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"
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="#F44336"
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="#9C27B0"
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="#03A9F4"
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="#FFEB3B"
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="#4CAF50"
android:layout_below="@id/V_2"
android:layout_toRightOf="@id/V_1"/>

<View
android:id="@+id/V_7"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#FF5722"
android:layout_below="@id/V_1"
android:layout_toLeftOf="@id/V_1"/>

<View
android:id="@+id/V_8"
android:layout_width="100dp"
android

 

 作业3:制作登录界面(要求至少2个edittext,1个button,最好有一个imageview要求美观)

<?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"
android:orientation="vertical"
android:background="#FFFFFF">

<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:background="@drawable/tx"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"/>

<TextView
android:layout_width="330dp"
android:layout_height="70dp"
android:background="@drawable/test"
android:layout_centerHorizontal="true"
android:layout_marginTop="170dp"
android:text="12345678909"
android:textSize="30sp"
android:textStyle="bold"
android:gravity="center"/>

<EditText
android:layout_width="330dp"
android:layout_height="70dp"
android:background="@drawable/test"
android:layout_centerHorizontal="true"
android:layout_marginTop="255dp"
android:text="请输入密码"
android:textSize="18sp"
android:gravity="center"
android:textColor="#A2A2A2"/>

<Button
android:layout_width="250dp"
android:layout_height="60dp"
android:background="@drawable/btn_1"
android:layout_centerHorizontal="true"
android:layout_marginTop="360dp"
android:text="登录"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="#FFFFFF"/>

</RelativeLayout>

 

posted @ 2021-09-07 22:12  于泓旭  阅读(18)  评论(0编辑  收藏  举报