第1-2周作业
作业1:安装环境,截图编程界面,截图运行界面
作业2:九宫格
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/l_1" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="10dp" android:background="#00BCD4"> <View android:id="@+id/v_1" android:layout_width="50dp" android:layout_height="50dp" android:layout_centerInParent="true" android:background="#F44336" /> <View android:id="@+id/v_2" android:layout_width="50dp" android:layout_height="50dp" android:background="#E91E63" android:layout_centerInParent="true" android:layout_toLeftOf="@id/v_1"/> <View android:id="@+id/v_3" android:layout_width="50dp" android:layout_height="50dp" android:background="#C81EE6" android:layout_centerInParent="true" android:layout_toRightOf="@id/v_1"/> <View android:id="@+id/v_4" android:layout_width="50dp" android:layout_height="50dp" android:background="#089286" android:layout_centerInParent="true" android:layout_above="@id/v_1"/> <View android:id="@+id/v_5" android:layout_width="50dp" android:layout_height="50dp" android:background="#9EE44D" android:layout_centerInParent="true" android:layout_below="@id/v_1"/> <View android:id="@+id/v_6" android:layout_width="50dp" android:layout_height="50dp" android:background="#3F51B5" android:layout_centerInParent="true" android:layout_below="@id/v_1" android:layout_toRightOf="@id/v_5"/> <View android:id="@+id/v_7" android:layout_width="50dp" android:layout_height="50dp" android:background="#FFEB3B" android:layout_centerInParent="true" android:layout_below="@id/v_1" android:layout_toLeftOf="@id/v_5"/> <View android:id="@+id/v_8" android:layout_width="50dp" android:layout_height="50dp" android:background="#9EE44D" android:layout_centerInParent="true" android:layout_above="@id/v_1" android:layout_toRightOf="@id/v_4"/> <View android:id="@+id/v_9" android:layout_width="50dp" android:layout_height="50dp" android:background="#FF9800" android:layout_centerInParent="true" android:layout_above="@id/v_1" android:layout_toLeftOf="@id/v_4"/> </RelativeLayout>
作业3:布局界面(QQ群截图)
<?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="#00BCD4" android:layout_margin="10dp" android:orientation="vertical"> <View android:id="@+id/v_1" android:layout_width="match_parent" android:layout_height="80dp" android:background="#F44336" android:layout_alignParentTop="true"/> <View android:id="@+id/v_2" android:layout_width="match_parent" android:layout_height="80dp" android:background="#FFEB3B" android:layout_alignParentBottom="true"/> <View android:id="@+id/v_3" android:layout_width="80dp" android:layout_height="550dp" android:layout_below="@+id/v_1" android:layout_above="@+id/v_2" android:layout_alignParentLeft="true" android:background="#673AB7" /> <View android:id="@+id/v_4" android:layout_width="80dp" android:layout_height="550dp" android:layout_below="@+id/v_1" android:layout_above="@+id/v_2" android:layout_alignParentRight="true" android:background="#E91E63" /> </RelativeLayout>
作业4:制作登录界面(要求至少2个edittext,1个button,最好有一个imageview要求美观)
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/r_1" android:background="#FFFEFE" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:id="@+id/iv_1" android:layout_width="70dp" android:layout_height="70dp" android:layout_centerHorizontal="true" android:layout_marginTop="100dp" android:background="@drawable/head" /> <LinearLayout android:id="@+id/l_1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/iv_1" android:layout_centerVertical="true" android:layout_marginTop="70dp" android:layout_marginBottom="10dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:background="@drawable/underline"> <TextView android:id="@+id/t_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="20dp" android:text="请输入账号" android:textColor="#6D6868" android:textSize="15sp"/> <EditText android:id="@+id/e_1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:padding="10dp" android:background="@null" /> </LinearLayout> <LinearLayout android:id="@+id/l_2" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/l_1" android:layout_centerVertical="true" android:layout_marginTop="10dp" android:layout_marginBottom="10dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:background="@drawable/underline"> > <TextView android:id="@+id/v_2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="20dp" android:text="请输入密码" android:textColor="#6D6868" android:textSize="15sp"/> <EditText android:id="@+id/e_2" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:padding="10dp" android:background="@null" /> </LinearLayout>> <Button android:id="@+id/b_1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/l_2" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="50dp" android:background="@drawable/underline_button" android:text="登录" android:textSize="15sp"/> </RelativeLayout>