安卓第一二周作业
作业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/ll_1" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FFFFFF"> <View android:id="@+id/V_1" android:layout_width="100dp" android:layout_height="100dp" android:background="#000000" android:layout_centerInParent="true"/> <View android:id="@+id/V_2" android:layout_width="100dp" android:layout_height="100dp" android:background="#4CAF50" 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="#FFEB3B" 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="#E91E63" 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="#FF5722" 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="#00BCD4" android:layout_below="@id/V_1" android:layout_toRightOf="@id/V_7"/> <View android:id="@+id/V_9" android:layout_width="100dp" android:layout_height="100dp" android:background="#4CAF50" android:layout_below="@id/V_1" android:layout_toRightOf="@id/V_8"/> </RelativeLayout>
作业3:布局界面(QQ群截图)
<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout 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"> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="#FFFF00"/> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="4" android:background="#FE2E2E" android:orientation="horizontal"> <View android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#0000FF" /> <View android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="4" android:background="#2EFE2E" /> <View android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#0000FF"/> </LinearLayout>> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="#FFFF00"/> </LinearLayout>
作业3:制作登录界面(要求至少2个edittext,1个button,最好有一个imageview要求美观)