第一、二周作业
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:id="@+id/r_1" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="20dp"> <View android:id="@+id/v_1" android:layout_width="90dp" android:layout_height="90dp" android:background="#D47DE6" android:layout_centerInParent="true"/> <View android:id="@+id/v_2" android:layout_width="90dp" android:layout_height="90dp" android:background="#1231DA" android:layout_above="@id/v_1" android:layout_toLeftOf="@id/v_1"/> <View android:id="@+id/v_3" android:layout_width="90dp" android:layout_height="90dp" android:background="#1ACE21" android:layout_below="@id/v_2" android:layout_toLeftOf="@id/v_1"/> <View android:id="@+id/v_4" android:layout_width="90dp" android:layout_height="90dp" android:background="#EBD304" android:layout_toLeftOf="@id/v_1" android:layout_below="@id/v_3"/> <View android:id="@+id/v_5" android:layout_width="90dp" android:layout_height="90dp" android:background="#B1C210" android:layout_below="@id/v_1" android:layout_toRightOf="@id/v_1"/> <View android:id="@+id/v_6" android:layout_width="90dp" android:layout_height="90dp" android:background="#DB7069" android:layout_above="@id/v_5" android:layout_toRightOf="@id/v_1"/> <View android:id="@+id/v_7" android:layout_width="90dp" android:layout_height="90dp" android:background="#51B1A8" android:layout_above="@id/v_6" android:layout_toRightOf="@id/v_1"/> <View android:id="@+id/v_8" android:layout_width="90dp" android:layout_height="90dp" android:background="#0685EE" android:layout_below="@id/v_1" android:layout_toRightOf="@id/v_2"/> <View android:id="@+id/v_9" android:layout_width="90dp" android:layout_height="90dp" android:background="#DAEE06" android:layout_above="@id/v_1" android:layout_toRightOf="@id/v_2"/> </RelativeLayout>
作业3、
<?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:layout_margin="20dp" android:orientation="horizontal"> <View android:id="@+id/v_1" android:layout_width="match_parent" android:layout_height="100dp" android:background="#D889E6" android:layout_alignParentTop="true"/> <View android:id="@+id/v_2" android:layout_width="match_parent" android:layout_height="100dp" android:background="#D889E6" android:layout_alignParentBottom="true"/> <View android:id="@+id/v_3" android:layout_width="90dp" android:layout_height="500dp" android:layout_below="@id/v_1" android:layout_above="@id/v_2" android:background="#EBA8BF" android:layout_alignParentLeft="true"/> <View android:id="@+id/v_4" android:layout_width="90dp" android:layout_height="500dp" android:layout_below="@id/v_1" android:layout_above="@id/v_2" android:background="#EBA8BF" android:layout_alignParentRight="true"/> </RelativeLayout>
作业4、
<?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="#E8CFEC" 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/denglu" 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/kw" 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="40dp" android:padding="20dp" android:background="#DB0CFF" android:text="登录" android:textSize="24sp"/> <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/tp"/> </RelativeLayout>