第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"
    android:id="@+id/rl-1"
    android:padding="5dp"
    >

    <View
        android:id="@+id/v-1"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_centerInParent="true"
        android:background="#E60808"/>

    <View
        android:id="@+id/v-2"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_above="@+id/v-1"
        android:layout_centerInParent="true"
        android:background="#2942DD"/>

    <View
        android:id="@+id/v-3"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_below="@+id/v-1"
        android:layout_centerInParent="true"
        android:background="#DAEC27"/>

    <View
        android:id="@+id/v-4"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_toLeftOf="@+id/v-1"
        android:layout_centerInParent="true"
        android:background="#733DE4"/>
    <View
        android:id="@+id/v-5"
        android:layout_width="100dp"
        android:layout_height="100dp"
       android:layout_toRightOf="@+id/v-1"
        android:layout_centerInParent="true"
        android:background="#7FC52D"/>
    <View
        android:id="@+id/v-6"
        android:layout_width="100dp"
        android:layout_height="100dp"
       android:layout_toRightOf="@+id/v-2"
        android:layout_above="@+id/v-5"
        android:background="#18C5B5"/>
    <View
        android:id="@+id/v-7"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_above="@+id/v-4"
        android:layout_toLeftOf="@+id/v-2"
        android:background="#F56537"/>
    <View
        android:id="@+id/v-8"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_below="@+id/v-4"
        android:layout_toLeftOf="@+id/v-3"
        android:background="#DA0D53"/>
    <View
        android:id="@+id/v-9"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_below="@+id/v-5"
        android:layout_toRightOf="@+id/v-3"
        android:background="#086F12"/>








</RelativeLayout>

作业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="#06DAF5"
    tools:context=".MainActivity">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="600dp"
        android:layout_centerInParent="true"
        android:background="#41B0BD"
        android:orientation="horizontal">

    <View
        android:id="@+id/v-1"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="2"
        android:background="#D00AF1"
        />
    <View
        android:id="@+id/v-2"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="5"
        android:background="#FFEB3B"
        />
    <View
        android:id="@+id/v-3"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="2"
        android:background="#B2C404"
        />
    </LinearLayout>>

</RelativeLayout>

作业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"
    >
    <ImageView
        android:id="@+id/iv_1"
        android:layout_width="200dp"
        android:layout_height="200dp"
       android:background="@drawable/shuaiqinanhai"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="40dp"/>

    <EditText
        android:id="@+id/et-1"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:hint="请输入用户名"
        android:textColorHint="#5A12DB"
        android:textSize="20sp"
        android:layout_margin="10dp"
        android:padding="10dp"
        android:drawableLeft="@drawable/yonghu"
        android:background="@drawable/bt2"
        android:layout_below="@+id/iv_1"
        />
    <EditText
        android:id="@+id/et-2"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:hint="请输入账号密码"
        android:textColorHint="#D413F5"
        android:textSize="20sp"
        android:layout_margin="10dp"
        android:padding="10dp"
        android:background="@drawable/bt2"
        android:drawableLeft="@drawable/mima"
        android:layout_below="@+id/et-1"
        />
    <Button
        android:layout_width="200dp"
        android:layout_height="100dp"
        android:layout_below="@+id/et-2"
        android:layout_centerHorizontal="true"
        android:hint="登录"
        android:background="@drawable/bt1"
        android:textColorHint="#FF9800"
        android:textSize="40sp"
        android:layout_marginTop="50dp"/>

</RelativeLayout>

posted @ 2021-08-26 20:20  请叫我妖玉大侠  阅读(37)  评论(0)    收藏  举报