Looks like that one way to avoid nested weights on Android's LinearLayout is to set a weight parameter to the nested LinearLayout. For instance, this layout:
<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:orientation="vertical"
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=".MainActivity" >
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0"
android:background="#FF0000" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2.0" >
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="10.0"
android:background="#00FF00" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="20.0"
android:orientation="vertical" >
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="100.0"
android:background="#0000FF" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="200.0" >
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1000.0"
android:background="#FF0000" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2000.0"
android:orientation="vertical" >
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="10000.0"
android:background="#00FF00" />
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="20000.0"
android:background="#0000FF" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Produces this:
Although it is heavily nested and the nested weights are much bigger than the parent weights.
Does the LinearLayout weight parameter really stops the weight propagation? This is true for all API levels?
EDIT
To be more clear: I want to use nested weights without performance loss and without using other layouts like RelativeLayout, I think that this is a solution, but I'm not so sure.