安卓界面要实现这两行三列的布局,该怎样写代码?

如图,求给出简洁的示例代码。

闲着没事 给你写了

<?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="wrap_content"

    android:background="#FFF"

    android:orientation="horizontal" >


    <Button

        android:layout_width="0dp"

        android:layout_height="match_parent"

        android:layout_weight="1"

        android:text="BUTTON1" />


    <LinearLayout

        android:layout_width="0dp"

        android:layout_height="match_parent"

        android:layout_weight="1.5"

        android:orientation="vertical" >


        <LinearLayout

            android:layout_width="match_parent"

            android:layout_height="0dp"

            android:layout_weight="1"

            android:orientation="horizontal" >


            <TextView

                android:layout_width="wrap_content"

                android:layout_height="match_parent"

                android:text="Text01"

                android:textColor="#000" />


            <TextView

                android:layout_width="wrap_content"

                android:layout_height="match_parent"

                android:text="Text01"

                android:textColor="#000" />


            <TextView

                android:layout_width="wrap_content"

                android:layout_height="match_parent"

                android:text="Text01"

                android:textColor="#000" />

        </LinearLayout>


        <LinearLayout

            android:layout_width="match_parent"

            android:layout_height="0dp"

            android:layout_weight="1"

            android:orientation="horizontal" >


            <TextView

                android:layout_width="wrap_content"

                android:layout_height="match_parent"

                android:text="Text02"

                android:textColor="#000" />


            <TextView

                android:layout_width="wrap_content"

                android:layout_height="match_parent"

                android:text="Text02"

                android:textColor="#000" />


            <TextView

                android:layout_width="wrap_content"

                android:layout_height="match_parent"

                android:text="Text02"

                android:textColor="#000" />

        </LinearLayout>

    </LinearLayout>


    <Button

        android:layout_width="0dp"

        android:layout_height="match_parent"

        android:layout_weight="1"

        android:text="BUTTON2" />


</LinearLayout>

温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网