android_04_线性布局
2016-10-02 12:03
232 查看
演示效果:
布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.xsism.linearlayout.MainActivity"
android:orientation="vertical"
>
<LinearLayout
android:layout_weight="1"
android:layout_height="0dp"
android:layout_width="match_parent"
android:orientation="horizontal"
>
<TextView
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#ff0000"
/>
<TextView
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#00ff00"
/>
<TextView
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#0000ff"
/>
<TextView
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="@android:color/black"
/>
</LinearLayout>
<LinearLayout
android:layout_weight="1"
android:layout_height="0dp"
android:layout_width="match_parent"
android:orientation="vertical"
>
<TextView
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#ff0000"
/>
<TextView
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#00ff00"
/>
<TextView
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#0000ff"
/>
<TextView
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#000000"
/>
</LinearLayout>
</LinearLayout>
布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.xsism.linearlayout.MainActivity"
android:orientation="vertical"
>
<LinearLayout
android:layout_weight="1"
android:layout_height="0dp"
android:layout_width="match_parent"
android:orientation="horizontal"
>
<TextView
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#ff0000"
/>
<TextView
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#00ff00"
/>
<TextView
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#0000ff"
/>
<TextView
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="@android:color/black"
/>
</LinearLayout>
<LinearLayout
android:layout_weight="1"
android:layout_height="0dp"
android:layout_width="match_parent"
android:orientation="vertical"
>
<TextView
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#ff0000"
/>
<TextView
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#00ff00"
/>
<TextView
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#0000ff"
/>
<TextView
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#000000"
/>
</LinearLayout>
</LinearLayout>
相关文章推荐
- Android 线性布局和帧布局
- Android布局之LinearLayout(线性布局)
- Android布局之Linearyout(线性)布局
- Android布局(线性布局 Linear Layout )(相对布局 Relative Layout)
- Android开发教程 --- 布局(线性布局 Linear Layout )(相对布局 Relative Layout)
- Android 线性布局详解
- android基础——界面布局(二) 线性布局
- Android--LinearLayout(线性布局)
- android布局Linear Layout(线性布局)
- Android布局之LinearLayout(线性布局)
- Android布局学习——线性布局和相对布局混合使用
- Android UI基本测验:线性布局
- Android用户界面设计:线性布局
- android布局之线性布局
- Android UI Design 04 : 相对布局 Relative Layouts
- Android布局之LinearLayout(线性布局)
- Android用户界面设计:线性布局
- Android UI Design 03 : 线性布局 Linear Layout
- Android线性布局
- android--04activity的布局管理器