【问题标题】:How to make this particular layout?如何制作这种特殊的布局?
【发布时间】:2019-02-06 11:47:33
【问题描述】:

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

【问题讨论】:

标签: android xml android-layout styles material-design


【解决方案1】:

试试这个

<?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>

输出

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-31
    • 1970-01-01
    • 2021-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多