corner rect bg layout

来源:互联网 发布:吉他基本乐理知识知乎 编辑:程序博客网 时间:2024/04/27 15:06


drawale/corner.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android" >

    <corners android:radius="10dp"/>
    <solid android:color="#FFFFFFFF"/>
    <stroke android:color="#FF000000" android:width="1dp"/>
 

</shape>


layout/main.xml


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="vertical" >


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_height="wrap_content"
        android:background="@drawable/corners_layout"
        android:orientation="vertical" >


        <RelativeLayout
            android:paddingTop="10dp"
            android:layout_weight="1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_above="@+id/center_center"
            android:layout_alignParentTop="true" >


            <LinearLayout
                android:layout_marginTop="10dp"
                android:layout_below="@+id/text1"
                android:id="@+id/center_center"
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:background="#000000"
                android:orientation="vertical" >
            </LinearLayout>


            <TextView
                android:id="@+id/text1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_centerVertical="true"
                android:layout_marginLeft="20dp"
                android:text="ninini" />


        </RelativeLayout>


        <RelativeLayout
             android:layout_weight="1"
            android:id="@+id/relative_two"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
             android:paddingTop="10dp"
            android:layout_centerVertical="true" >


            <TextView
               
                android:id="@+id/text2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginLeft="20dp"
                android:text="ninini" />


            <LinearLayout
                android:layout_below="@+id/text2"
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_marginTop="10dp"
                android:background="#000000"
                android:orientation="vertical" >
            </LinearLayout>
        </RelativeLayout>


        <RelativeLayout
             android:layout_weight="1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
           android:paddingTop="10dp"
           android:paddingBottom="10dp"
            android:layout_centerVertical="true" >


            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginLeft="20dp"
                android:text="ninini" />
        </RelativeLayout>
    </LinearLayout>


</LinearLayout>

0 0
原创粉丝点击