扣丁学院安卓学习第二阶段第二天作业之LinearLayout
<?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:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.5"
android:background="#ffd700" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.5"
android:background="#e6e6fa" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.5"
android:background="#9370db" />
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:orientation="horization" >
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#ff6347" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#00ff7f" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#800080" />
</LinearLayout>
</LinearLayout>
扣丁学院安卓学习第二阶段第二天作业之RelativeLayout
<?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="#2f4f4f">
<TextView
android:layout_width="96dp"
android:layout_height="96dp"
android:background="#ffff00"
android:id="@+id/textView1"
android:layout_column="1"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="96dp"
android:layout_height="96dp"
android:background="#ffa07a"
android:id="@+id/textView2"
android:layout_below="@+id/textView1"
android:layout_toRightOf="@+id/textView1" />
<TextView
android:layout_width="96dp"
android:layout_height="96dp"
android:background="#800080"
android:id="@+id/textView3"
android:layout_below="@+id/textView2"
android:layout_toRightOf="@+id/textView2" />
<TextView
android:layout_width="96dp"
android:layout_height="96dp"
android:background="#000000"
android:id="@+id/textView4"
android:layout_below="@+id/textView3"
android:layout_toRightOf="@+id/textView3" />
<TextView
android:layout_width="96dp"
android:layout_height="96dp"
android:background="#6a5acd"
android:id="@+id/textView5"
android:layout_below="@+id/textView4"
android:layout_toRightOf="@+id/textView2" />
<TextView
android:layout_width="96dp"
android:layout_height="96dp"
android:background="#6a5acd"
android:id="@+id/textView6"
android:layout_below="@+id/textView5"
android:layout_toRightOf="@+id/textView1" />
</RelativeLayout>