安卓中简单的线性布局

来源:互联网 发布:java 重写 重载 编辑:程序博客网 时间:2024/05/10 08:17
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"              android:orientation="vertical"              android:layout_width="match_parent"              android:layout_height="match_parent">    <LinearLayout            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:layout_weight="1"            android:background="#ff0000"            android:orientation="horizontal">        <TextView                android:layout_width="wrap_content"                android:layout_height="match_parent"                android:layout_weight="1"                android:background="#000000"/>        <TextView                android:layout_width="wrap_content"                android:layout_height="match_parent"                android:layout_weight="1"                android:background="#FF00FF"/>        <TextView                android:layout_width="wrap_content"                android:layout_height="match_parent"                android:layout_weight="1"                android:background="#00FF00"/>        <TextView                android:layout_width="wrap_content"                android:layout_height="match_parent"                android:layout_weight="1"                android:background="#00FF"/>    </LinearLayout>    <LinearLayout            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:layout_weight="1"            android:background="#00ff00"            android:orientation="vertical">        <TextView                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:layout_weight="1"                android:background="#FFFFFF"/>        <TextView                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:layout_weight="1"                android:background="#00FF00"/>        <TextView                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:layout_weight="1"                android:background="#0000FF"/>        <TextView                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:layout_weight="1"                android:background="#FF0000"/>    </LinearLayout></LinearLayout>

效果预览:
这里写图片描述

0 0
原创粉丝点击