I want to set UI based on android:layout_weight
.I have following code structure
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="25"
android:orientation="horizontal" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button1" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="25"
android:orientation="horizontal" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button1" />
</LinearLayout>
<ListView
android:id="@+id/relatedContent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="60dp"
android:layout_weight="50"
here=""
problem=""
android:cacheColorHint="@android:color/transparent"
android:divider="@drawable/divider"
android:listSelector="@drawable/listview_selector_color" >
</ListView>
Everything work properly but when we set ListView id then it streatch all layout.So please can anyone help me out about this.Thanks