Ich habe ein Problem beim Aufteilen des Bildschirms mit einem linearenLayout, Mein Ziel ist es in 9 Pisces - teilen Wenn ich begann mit dem LinearLayout zu spielen Ich bin zu dem folgenden Ergebnis gekommen:Probleme mit dem Aufteilen des Bildschirms mit LinearLayout
http://imageshack.us/photo/my-images/4/firstna.png/
mit dem folgenden xML-Code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:baselineAligned="false">
<FrameLayout
android:gravity="center_horizontal"
android:background="#aa0000"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1">
</FrameLayout>
<FrameLayout
android:gravity="center_horizontal"
android:background="#00aa00"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="4"/>
<FrameLayout
android:gravity="center_horizontal"
android:background="#aaaa00"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"/>
</LinearLayout>
</LinearLayout>
später, als ich versuchte Inhalt nach links hinzuzufügen FrameLayout es die Ratte geändert io dieser FrameLayout (was das Problem ist, ..):
http://imageshack.us/photo/my-images/692/secondp.png/
mit dem folgenden Code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:baselineAligned="false">
<FrameLayout
android:gravity="center_horizontal"
android:background="#aa0000"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<TextView
android:text="row one"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<TextView
android:text="row two"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<TextView
android:text="row three"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<TextView
android:text="row four"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>
</FrameLayout>
<FrameLayout
android:gravity="center_horizontal"
android:background="#00aa00"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="4"/>
<FrameLayout
android:gravity="center_horizontal"
android:background="#aaaa00"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"/>
</LinearLayout>
</LinearLayout>
Ich möchte die Möglichkeit haben, die Layouts nur mit dem layout_weight Attribut zu steuern - Wenn das Hinzufügen von Inhalt zu FrameLayout sein Verhältnis ändert, würde ich Ihre Hilfe benötigen, um einen anderen Container zu finden, in dem das Verhältnis gespeichert wird. Danke.