右击/res/layout文件夹,选择New–>AndroidXML File, 选择线性布局Linear Layout,完成。
vertical 垂直 horizontal 水平
[界面布局]
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" //match_parent和fill_parent是一个意思
android:layout_height="match_parent" //match_parent和fill_parent是一个意思
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="设置"
android:textColor="#ffffff" //字体颜色
android:background="#66000000" //背景色支持透明度
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="70dp" >
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp" //指定视图左边额外的空间为8个像素
android:layout_marginTop="8dp" //指定视图上边额外的空间为8个像素
android:textColor="#000000"
android:textSize="20dp" //字体大小
android:text="内存" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_below="@id/tv"
android:textColor="#66000000"
android:textSize="14dp"
android:text="空间清理" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<View
android:background="#88000000"
android:layout_width="fill_parent"
android:layout_height="0.1dp"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="100dp" >
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:textColor="#000000"
android:textSize="20dp"
android:text="应用分身" />
<TextView
android:id="@+id/tv_QQ"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_below="@id/tv1"
android:textColor="#66000000"
android:textSize="14dp"
android:text="QQ" />
<TextView
android:id="@+id/tv_wx"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_below="@id/tv_QQ"
android:textColor="#66000000"
android:textSize="14dp"
android:text="微信" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="32dp"
/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="58dp"
/>
</RelativeLayout>
</LinearLayout>