图片布局嵌套

来源:互联网 发布:淘宝达人发帖软件 编辑:程序博客网 时间:2024/06/05 03:54
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:id="@+id/activity_main"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical"    tools:context="com.example.administrator.weighttest.MainActivity">    <LinearLayout        android:layout_width="match_parent"        android:layout_height="0dp"        android:layout_weight="1"        android:background="@color/colorPrimary">        <LinearLayout            android:layout_width="0dp"            android:layout_height="match_parent"            android:orientation="vertical"            android:layout_weight="1"            android:background="#fd0000">            <TextView                android:layout_width="match_parent"                android:layout_height="0dp"                android:layout_weight="1"                android:text="横1-1"                android:textSize="20dp"/>            <TextView                android:layout_width="match_parent"                android:layout_height="0dp"                android:layout_weight="1"                android:text="横1-2"                android:textSize="20dp"                android:background="#fb002f"/>            <TextView                android:layout_width="match_parent"                android:layout_height="0dp"                android:layout_weight="1"                android:text="横1-3"                android:textSize="20dp"                android:background="#fb0060"/>            <TextView                android:layout_width="match_parent"                android:layout_height="0dp"                android:layout_weight="1"                android:text="横1-4"                android:textSize="20dp"                android:background="#fc0099"/>        </LinearLayout>        <TextView            android:layout_width="0dp"            android:layout_height="match_parent"            android:layout_weight="1"            android:text="横2"            android:textSize="20dp"            android:background="#008081"/>        <TextView            android:layout_width="0dp"            android:layout_height="match_parent"            android:layout_weight="1"            android:text="横3"            android:textSize="20dp"            android:background="#0000aa"/>        <TextView            android:layout_width="0dp"            android:layout_height="match_parent"            android:layout_weight="1"            android:text="横4"            android:textSize="20dp"            android:background="#fba300"/>    </LinearLayout>    <!--下边一半 -->    <LinearLayout        android:layout_width="match_parent"        android:layout_height="0dp"        android:layout_weight="1"        android:background="@color/colorAccent"        android:orientation="vertical">        <LinearLayout            android:layout_width="match_parent"            android:layout_height="0dp"            android:layout_weight="1"            android:background="#00fb00"            android:orientation="horizontal">            <TextView                android:layout_width="0dp"                android:layout_height="match_parent"                android:layout_weight="1"                android:text="纵1-1"                android:textSize="20dp"/>            <TextView                android:layout_width="0dp"                android:layout_height="match_parent"                android:layout_weight="1"                android:background="#00fd2f"                android:text="纵1-2"                android:textSize="20dp"/>            <TextView                android:layout_width="0dp"                android:layout_height="match_parent"                android:layout_weight="1"                android:background="#00fc61"                android:text="纵1-3"                android:textSize="20dp"/>            <TextView                android:layout_width="0dp"                android:layout_height="match_parent"                android:layout_weight="1"                android:background="#00fc9a"                android:text="纵1-4"                android:textSize="20dp"/>        </LinearLayout>        <TextView            android:layout_width="match_parent"            android:layout_height="0dp"            android:layout_weight="1"            android:background="#da9fda"            android:text="纵2"            android:textSize="20dp"/>        <TextView            android:layout_width="match_parent"            android:layout_height="0dp"            android:layout_weight="1"            android:background="#008081"            android:text="纵3"            android:textSize="20dp"/>        <TextView            android:layout_width="match_parent"            android:layout_height="0dp"            android:layout_weight="1"            android:background="#fca400"            android:text="纵4"            android:textSize="20dp"/>    </LinearLayout></LinearLayout>
0 0