Используйте android: layout_weight, чтобы установить соотношение элементов.
Редактировать: я прикрепил базовый макет, который вам нужен, он содержит только разделенный пользовательский интерфейс.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tableLayout1"
android:layout_weight="2" >
<TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:text="Mobilizitaion" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<Spinner android:id="@+id/spinner1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Spinner>
</TableRow>
<TableRow android:id="@+id/tableRow2" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:text="Main" android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<Spinner android:id="@+id/spinner2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Spinner>
</TableRow>
<TableRow android:id="@+id/tableRow3" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:text="Services" android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<Spinner android:id="@+id/spinner3" android:layout_width="wrap_content" android:layout_height="wrap_content"></Spinner>
</TableRow>
<TableRow android:id="@+id/tableRow4" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:text="Etc" android:id="@+id/textView4" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<Spinner android:id="@+id/spinner4" android:layout_width="wrap_content" android:layout_height="wrap_content"></Spinner>
</TableRow>
</TableLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
</LinearLayout>
</LinearLayout>
Когда представление создает только видимый список, после того, как я щелкну один из элементов списка, соотношение сторон будет установлено на 1: 2.
Вот XML:
<FrameLayout
android:id="@+id/fragment_list"
android:layout_weight="0"
android:layout_width="fill_parent"
android:layout_height="match_parent" />
<FrameLayout
android:id="@+id/framelayout_for_right_fragment"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="0" />
Это код Java для установки соотношения фрагментов.
final FrameLayout leftFragment = (FrameLayout) findViewById(R.id.fragment_list);
leftFragment.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, 2));
final FrameLayout rightFragment = (FrameLayout) findViewById(R.id.framelayout_for_right_fragment);
rightFragment.setAnimation(AnimationHelper.inFromRight());
rightFragment.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, 1));