[mobilesafe] 09_程序设置界面布局

Android 4.0


1、布局 setting_view_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- 4、SettingActivity布局文件,设置选项 -->
<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="50dp"
        android:background="#ff1100"
        android:gravity="center"  //TextView组件中的内容居中显示,只是对该组件内有效。
        android:text="@string/activity_setting_center"
        android:textColor="#00ff00"
        android:textSize="20sp" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="65dp" >

        <TextView
            android:id="@+id/tv_setting_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dip"
            android:layout_marginTop="8dip"
            android:text="自动确认时间和日期"
            android:textSize="18sp"
            android:textColor="#ff000000" />

        <TextView
            android:id="@+id/tv_setting_description"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/tv_setting_title"
            android:layout_marginLeft="5dip"
            android:layout_marginTop="5dip"
            android:text="使用网络上的时间"
            android:textSize="14sp"
            android:textColor="#99000000" />

        <CheckBox
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true" />

           //一条灰白色的线条
        <View
            android:layout_marginLeft="5dip"
            android:layout_marginRight="5dip"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:layout_alignParentBottom="true"
            android:background="#77000000" />

    </RelativeLayout>
</LinearLayout>
2、结果: