第一次作业
作业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=".MainActivity"> <View android:id="@+id/V_1" android:layout_width="100dp" android:layout_height="100dp" android:background="#99000000" android:layout_centerInParent="true"/> <View android:id="@+id/V_2" android:layout_width="100dp" android:layout_height="100dp" android:background="#4CA3AF" 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="#FF3B90" 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="#2196F3" 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="#FF5722" 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="#FFE222" android:layout_below="@id/V_4" android:layout_toRightOf="@id/V_1"/> <View android:id="@+id/V_7" android:layout_width="100dp" android:layout_height="100dp" android:background="#673AB7" android:layout_below="@id/V_5" android:layout_toLeftOf="@id/V_1"/> <View android:id="@+id/V_8" android:layout_width="100dp" android:layout_height="100dp" android:background="#2196F3" android:layout_below="@id/V_1" android:layout_toRightOf="@id/V_7"/> <View android:id="@+id/V_9" android:layout_width="100dp" android:background="#8BC34A" android:layout_height="100dp" android:layout_below="@id/V_1" android:layout_toRightOf="@id/V_8"/> </RelativeLayout>
作业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="#FFFFFF" android:layout_margin="10dp" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="#4CAF50"/> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="4" android:background="#0000FF0D" android:orientation="horizontal"> <View android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#2196F3"/> <View android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="4" android:background="#02FF5722"/> <View android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#2196F3"/> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="#4CAF50"/> </LinearLayout>
作业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:id="@+id/Tu_1" android:layout_width="80dp" android:layout_height="80dp" android:background="@drawable" android:layout_centerHorizontal="true" android:layout_marginTop="40dp"/> <ImageView android:layout_width="30dp" android:layout_height="30dp" android:background="@drawable/denglu" android:layout_marginTop="190dp" android:layout_marginLeft="100dp"/> <ImageView android:layout_width="20dp" android:layout_height="15dp" android:background="@drawablenjiao" android:layout_marginTop="200dp" android:layout_marginLeft="290dp"/> <TextView android:layout_width="300dp" android:layout_height="70dp" android:layout_centerHorizontal="true" android:layout_marginTop="170dp" android:background="@drawable/a1" android:text="123456789" android:gravity="center" android:textSize="25sp" android:textColor="#000000" /> <EditText android:layout_width="300dp" android:layout_height="70dp" android:layout_centerHorizontal="true" android:layout_marginTop="250dp" android:background="@drawable/a1" android:text="输入密码" android:gravity="center" android:textSize="20sp" android:textColor="#B8B8B8" android:textStyle="bold"/> <ImageButton android:layout_width="80dp" android:layout_height="80dp" android:background="@drawable/q1" android:layout_centerHorizontal="true" android:layout_marginTop="360dp"/> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:text="手机号登录 | 找回密码 | 新用户注册" android:gravity="center_horizontal" android:layout_marginTop="550dp"/> </RelativeLayout>