我有两种布局。其实5,3垂直一个在另一个之下,在中间一个我有2个并排布局。我需要他们是固定的大小,所以他们会改变。但是,只要我按下其中一个按钮,它们就会改变大小,如下图所示。如何让他们不变?无论如何,这是我的代码和图片。如何制作固定的XML布局?
<?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="match_parent"
android:orientation="vertical"
android:weightSum="20" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="3" >
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="15"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1" >
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1" >
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="2" >
</LinearLayout>
</LinearLayout>
这工作了水平移动,它是固定的,但它还是挺大的verticaly。 – user2083882 2013-03-18 14:39:03
查看编辑,我添加了第二个选项 – Sababado 2013-03-18 15:13:57