Android第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" tools:context=".GridActivity"> <GridLayout android:layout_width="match_parent" android:layout_height="match_parent" android:columnCount="3" android:rowCount="3"> <TextView android:layout_rowWeight="1" android:layout_columnWeight="1" android:background="#D0FA58"></TextView> <TextView android:layout_rowWeight="1" android:layout_columnWeight="1" android:background="#2E2EFE"></TextView> <TextView android:layout_rowWeight="1" android:layout_columnWeight="1" android:background="#B40404"></TextView> <TextView android:layout_rowWeight="1" android:layout_columnWeight="1" android:background="#848484"></TextView> <TextView android:layout_rowWeight="1" android:layout_columnWeight="1" android:background="#0B3B17"></TextView> <TextView android:layout_rowWeight="1" android:layout_columnWeight="1" android:background="#088A85"></TextView> <TextView android:layout_rowWeight="1" android:layout_columnWeight="1" android:background="#a349a4"></TextView> <TextView android:layout_rowWeight="1" android:layout_columnWeight="1" android:background="#E0F8E0"></TextView> <TextView android:layout_rowWeight="1" android:layout_columnWeight="1" android:background="#FFBF00"></TextView> </GridLayout></RelativeLay>
作业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:id="@+id/rl_1" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="10dp" android:orientation="horizontal"> <View android:id="@+id/v_1" android:layout_width="match_parent" android:layout_height="100dp" android:background="#F4FA58" android:layout_alignParentTop="true"/> <View android:id="@+id/v_2" android:layout_width="match_parent" android:layout_height="100dp" android:background="#FE642E" android:layout_centerInParent="true" android:layout_alignParentBottom="true"/> <View android:id="@+id/v_3" android:layout_width="100dp" android:layout_height="500dp" android:background="#81F7F3" android:layout_below="@id/v_1" android:layout_above="@id/v_2" android:layout_alignParentLeft="true" /> <View android:id="@+id/v_4" android:layout_width="100dp" android:layout_height="500dp" android:background="#A4A4A4" android:layout_below="@id/v_1" android:layout_above="@id/v_2" android:layout_alignParentRight="true"/> </RelativeLayout>
作业3:制作登录界面(要求至少2个edittext,1个button,最好有一个imageview要求美观)