Android 系统功能设置菜单 LinearLayout与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:orientation="vertical" >



    <TextView

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:background="#44000000"

        android:text="系统设置" />



    <RelativeLayout

        android:layout_width="match_parent"

        android:layout_height="55dp"

        android:background="#11000000"

        android:paddingBottom="5dp"

        android:paddingLeft="5dp"

        android:paddingTop="5dp" >



        <TextView

            android:id="@+id/tv_title"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="开启短信功能"

            android:textSize="20sp" />



        <TextView

            android:id="@+id/tv_content"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:layout_below="@id/tv_title"

            android:text="如果关闭该功能,则无法发送短信"

            android:textColor="#88000000"

            android:textSize="15sp" />



        <CheckBox

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:layout_alignParentRight="true"

            android:layout_centerVertical="true"

            android:layout_marginRight="22dp" />

    </RelativeLayout>



    <!-- 分割线 -->

    <View

        android:layout_width="match_parent"

        android:layout_height="0.1dp"

        android:background="#55000000" />



    <RelativeLayout

        android:layout_width="match_parent"

        android:layout_height="55dp"

        android:paddingBottom="5dp"

        android:paddingLeft="5dp"

        android:paddingTop="5dp" >



        <TextView

            android:id="@+id/tv_title2"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="开启通话功能"

            android:textSize="20sp" />



        <TextView

            android:id="@+id/tv_content2"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:layout_below="@id/tv_title2"

            android:text="如果关闭此功能,则无法拨打电话"

            android:textColor="#88000000"

            android:textSize="15sp" />



        <CheckBox

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:layout_alignParentRight="true"

            android:layout_centerVertical="true"

            android:layout_marginRight="22dp" />

    </RelativeLayout>

    

    <RelativeLayout

        android:layout_width="match_parent"

        android:layout_height="55dp"

        android:background="#11000000"

        android:paddingBottom="5dp"

        android:paddingLeft="5dp"

        android:paddingTop="5dp" >



        <TextView

            android:id="@+id/tv_title3"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="开启短信功能"

            android:textSize="20sp" />



        <TextView

            android:id="@+id/tv_content3"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:layout_below="@id/tv_title3"

            android:text="如果关闭该功能,则无法发送短信"

            android:textColor="#88000000"

            android:textSize="15sp" />



        <CheckBox

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:layout_alignParentRight="true"

            android:layout_centerVertical="true"

            android:layout_marginRight="22dp" />

    </RelativeLayout>



</LinearLayout>

 

你可能感兴趣的:(RelativeLayout)