Live2D

编写代码通过线性布局实现以下UI界⾯,该布局总共分为上中下三部分,每⼀个部分展示的是⼀本书的 详细信息

1.实现图片

2.代码

<?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:background="#e8e8e5"
    android:orientation="vertical"
    >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginTop="20dp"
        android:layout_weight="1"
        android:orientation="horizontal">

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="vertical"
            >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="21dp"
                android:layout_weight="2"
                android:background="#7ba8b0">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="此处为图书封面"
                    android:textSize="20sp"></TextView>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="#baccde">

            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="#bfd9d4"
                >
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="书名"
                    android:textSize="20sp">

                </TextView>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="#baccde">

            </LinearLayout>

        </LinearLayout>

        <!--中间颜色布局-->
        <LinearLayout
            android:layout_width="3dp"
            android:layout_height="match_parent"
            android:background="#7489ab">

        </LinearLayout>

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="2"
            android:orientation="vertical">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="#bfd9d4">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="概述"
                    android:textSize="20sp">

                </TextView>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="#2e4d5c">

            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="#bfd9d4">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="作者"
                    android:textSize="20sp">

                </TextView>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="#2e4d5c">

            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="#bfd9d4">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="日期"
                    android:textSize="20sp">

                </TextView>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="#2e4d5c">

            </LinearLayout>
        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginTop="20dp"
        android:layout_weight="1"
        android:background="#7ba8b0">
        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="vertical"
            >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="21dp"
                android:layout_weight="2"
                android:background="#7ba8b0">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="此处为图书封面"
                    android:textSize="20sp"></TextView>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="#baccde">

            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="#bfd9d4"
                >
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="书名"
                    android:textSize="20sp">

                </TextView>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="#baccde">

            </LinearLayout>

        </LinearLayout>

        <!--中间颜色布局-->
        <LinearLayout
            android:layout_width="3dp"
            android:layout_height="match_parent"
            android:background="#7489ab">

        </LinearLayout>

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="2"
            android:orientation="vertical">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="#bfd9d4">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="概述"
                    android:textSize="20sp">

                </TextView>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="#2e4d5c">

            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="#bfd9d4">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="作者"
                    android:textSize="20sp">

                </TextView>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="#2e4d5c">

            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="#bfd9d4">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="日期"
                    android:textSize="20sp">

                </TextView>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="#2e4d5c">

            </LinearLayout>
        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginTop="20dp"
        android:layout_marginBottom="20dp"
        android:layout_weight="1"
        android:background="#7ba8b0">
        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="vertical"
            >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="21dp"
                android:layout_weight="2"
                android:background="#7ba8b0">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="此处为图书封面"
                    android:textSize="20sp"></TextView>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="#baccde">

            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="#bfd9d4"
                >
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="书名"
                    android:textSize="20sp">

                </TextView>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="#baccde">

            </LinearLayout>

        </LinearLayout>

        <!--中间颜色布局-->
        <LinearLayout
            android:layout_width="3dp"
            android:layout_height="match_parent"
            android:background="#7489ab">

        </LinearLayout>

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="2"
            android:orientation="vertical">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="#bfd9d4">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="概述"
                    android:textSize="20sp">

                </TextView>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="#2e4d5c">

            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="#bfd9d4">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="作者"
                    android:textSize="20sp">

                </TextView>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="#2e4d5c">

            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="#bfd9d4">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="日期"
                    android:textSize="20sp">

                </TextView>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="10dp"
                android:background="#2e4d5c">

            </LinearLayout>
        </LinearLayout>
    </LinearLayout>
</LinearLayout>

3.感觉

明明很简单,但是确非常耗时。

 

posted @ 2020-02-29 21:21  幽香飞狐  阅读(82)  评论(0)    收藏  举报
Live2D