1、实现效果
图一:

图二:

2、xml代码
<RelativeLayout 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:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.example.lizelu.userinterfacedemo.Main2Activity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--垂直线性布局方式-->
<LinearLayout
android:layout_width="60pt"
android:layout_height="match_parent"
android:background="#ff0000"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50pt"
android:background="#0000ff"
android:orientation="horizontal">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00ff00"
android:orientation="horizontal">
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
网友评论