1-2周作业

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


作业2:九宫格

<?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=".GridActivity">

    <GridLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:columnCount="3"
        android:rowCount="3">
        <TextView
            android:layout_rowWeight="1"
            android:layout_columnWeight="1"
            android:background="#D0FA58"></TextView>


        <TextView
            android:layout_rowWeight="1"
            android:layout_columnWeight="1"
            android:background="#2E2EFE"></TextView>

        <TextView
            android:layout_rowWeight="1"
            android:layout_columnWeight="1"
            android:background="#B40404"></TextView>

        <TextView
            android:layout_rowWeight="1"
            android:layout_columnWeight="1"
            android:background="#848484"></TextView>

        <TextView
            android:layout_rowWeight="1"
            android:layout_columnWeight="1"
            android:background="#0B3B17"></TextView>

        <TextView
            android:layout_rowWeight="1"
            android:layout_columnWeight="1"
            android:background="#088A85"></TextView>

        <TextView
            android:layout_rowWeight="1"
            android:layout_columnWeight="1"
            android:background="#a349a4"></TextView>

        <TextView
            android:layout_rowWeight="1"
            android:layout_columnWeight="1"
            android:background="#E0F8E0"></TextView>

        <TextView 
            android:layout_rowWeight="1"
            android:layout_columnWeight="1"
            android:background="#FFBF00"></TextView>

    </GridLayout></RelativeLay>


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

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout   xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#01DFD7"
    android:layout_margin="15dp"
    android:orientation="vertical">



    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:background="#FFB90F"/>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="4"
        android:background="#EEAEEE"
        android:orientation="horizontal">
        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#F300BCD4"/>
        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="4"
            android:background="#90F48F36"/>
        <View
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#D800BCD4"/>
    </LinearLayout>>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:background="#2542FB2D"/>


作业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"
    tools:context=".MainActivity"
    android:orientation="vertical">

   <TextView
       android:id="@+id/tv_1"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_centerVertical="true"
       android:text="用户"
       android:textSize="24sp"
       android:layout_margin="10dp"
       android:padding="10dp"/>
    <TextView
        android:id="@+id/tv_2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:text="密码"
        android:textSize="24sp"
        android:layout_margin="10dp"
        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:background="@drawable/et_1"
        android:layout_toRightOf="@id/tv_1"
        android:drawableLeft="@drawable/user1"
        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:background="@drawable/et_1"
        android:layout_toRightOf="@id/tv_2"
        android:drawableLeft="@drawable/pas"
        android:drawablePadding="10dp"
        android:inputType="textPassword"/>
    <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:text="登录"
        android:textSize="24sp"
        android:background="#009688"/>
    <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/qmt"/>



</RelativeLayout>

 

posted @ 2021-08-29 15:01  丁朝明  阅读(31)  评论(0编辑  收藏  举报