Android第一次作业
<?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/B_0" android:layout_width="match_parent" android:layout_height="match_parent" > <View android:id="@+id/S_0" android:layout_width="100dp" android:layout_height="100dp" android:background="#5E8ADA" android:layout_centerInParent="true" /> <View android:id="@+id/S_1" android:layout_width="100dp" android:layout_height="100dp" android:background="#3D4B77" android:layout_above="@+id/S_0" android:layout_toLeftOf="@+id/S_0" /> <View android:id="@+id/S_2" android:layout_width="100dp" android:layout_height="100dp" android:background="#725EB8" android:layout_above="@+id/S_0" android:layout_toRightOf="@+id/S_1" /> <View android:id="@+id/S_3" android:layout_width="100dp" android:layout_height="100dp" android:background="#EBBF77" android:layout_above="@+id/S_0" android:layout_toRightOf="@+id/S_2" /> <View android:id="@+id/S_4" android:layout_width="100dp" android:layout_height="100dp" android:background="#E75EDF" android:layout_below="@+id/S_1" android:layout_toLeftOf="@+id/S_0" /> <View android:id="@+id/S_5" android:layout_width="100dp" android:layout_height="100dp" android:background="#CF4B66" android:layout_below="@+id/S_2" android:layout_toRightOf="@+id/S_0" /> <View android:id="@+id/S_6" android:layout_width="100dp" android:layout_height="100dp" android:background="#379640" android:layout_below="@+id/S_0" android:layout_centerInParent="true" /> <View android:id="@+id/S_7" android:layout_width="100dp" android:layout_height="100dp" android:background="#19BB94" android:layout_below="@+id/S_0" android:layout_toRightOf="@+id/S_6" /> <View android:id="@+id/S_8" android:layout_width="100dp" android:layout_height="100dp" android:background="#A8D665" android:layout_below="@+id/S_0" android:layout_toLeftOf="@+id/S_6" /> </RelativeLayout>
<?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:layout_margin="10dp" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_weight="1" android:background="#DD5F09" android:layout_height="0dp" /> <LinearLayout android:layout_width="match_parent" android:layout_weight="4" android:background="#B44C4C" android:orientation="horizontal" android:layout_height="0dp"> <View android:layout_weight="1" android:layout_height="match_parent" android:background="#489E68" android:layout_width="0dp" /> <View android:layout_weight="3" android:layout_height="match_parent" android:background="#AF52BE" android:layout_width="0dp"/> <View android:layout_weight="1" android:layout_height="match_parent" android:background="#D5BA59" android:layout_width="0dp"/> </LinearLayout>> <LinearLayout android:layout_width="match_parent" android:layout_weight="1" android:background="#C4426E" android:layout_height="0dp" /> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_height="match_parent" android:layout_width="match_parent"> <ImageView android:id="@+id/v_0" android:layout_width="100dp" android:layout_height="100dp" android:background="@drawable/tupian" android:layout_centerHorizontal="true" android:layout_marginTop="150dp" /> <EditText android:id="@+id/v_1" android:layout_width="match_parent" android:layout_height="50dp" android:hint="用户名" android:layout_marginTop="20dp" android:layout_marginHorizontal="10dp" android:padding="10dp" android:drawablePadding="10dp" android:layout_below="@id/v_0"/> <EditText android:id="@+id/v_3" android:layout_width="match_parent" android:layout_height="60dp" android:layout_marginLeft="10dp" android:hint="密码" android:padding="10dp" android:textColor="#000000" android:textSize="15sp" android:layout_below="@id/v_1" android:layout_margin="15dp" android:drawablePadding="10dp" tools:ignore="UnknownId"></EditText> <Button android:id="@+id/btn_1" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#E9E1E1" android:textColor="#474743" android:layout_below="@id/v_3" android:layout_margin="15dp" android:text="登录"></Button> </RelativeLayout>