Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何制作这种特殊的布局?_Android_Xml_Android Layout_Styles_Material Design - Fatal编程技术网

Android 如何制作这种特殊的布局?

Android 如何制作这种特殊的布局?,android,xml,android-layout,styles,material-design,Android,Xml,Android Layout,Styles,Material Design,大家好,我正在尝试制作一个新的应用程序,我在互联网上找到了这个布局。请任何人帮助我或告诉我如何制作此布局。试试这个 <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res

大家好,我正在尝试制作一个新的应用程序,我在互联网上找到了这个布局。请任何人帮助我或告诉我如何制作此布局。

试试这个

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="10dp"
    app:cardElevation="10dp"
    app:cardUseCompatPadding="true"
    tools:context=".MainActivity">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:padding="10dp">

            <TextView
                android:id="@+id/tvTop"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_alignParentEnd="true"
                android:layout_centerInParent="true"
                android:gravity="end"
                android:text="123" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/tvTop"
                android:layout_alignParentStart="true"
                android:layout_centerInParent="true"
                android:text="45446445446" />


            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/tvTop"
                android:layout_alignParentEnd="true"
                android:layout_centerInParent="true"
                android:text="45446445446" />

        </RelativeLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="2dp"
            android:background="@color/colorAccent" />

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:padding="10dp">

            <TextView
                android:id="@+id/tvTop2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_alignParentEnd="true"
                android:layout_centerInParent="true"
                android:gravity="end"
                android:text="123" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/tvTop2"
                android:layout_alignParentStart="true"
                android:layout_centerInParent="true"
                android:text="45446445446" />


            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/tvTop2"
                android:layout_alignParentEnd="true"
                android:layout_centerInParent="true"
                android:text="45446445446" />

        </RelativeLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="2dp"
            android:background="@color/colorAccent" />


    </LinearLayout>

</android.support.v7.widget.CardView>
输出


您将看到如何在这里创建布局->和此->