I am trying to accomplish in xml to show half frame layout and half grid layout without specifying it by myself with dp Here is what i want:
<?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" >
<FrameLayout
android:id="@+id/top"
android:layout_width="match_parent"
android:layout_height="250dp"
android:background="#FFFF00"
android:layout_weight="0"
android:orientation="vertical" >
</FrameLayout>
<GridView
android:id="@+id/buttom"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:numColumns="3" >
</GridView>
</LinearLayout>
I don’t want to specify size of this:
android:layout_height="250dp"
As i would then need to recreate this xml for all sizes. Maybe i could change something and android will calculate for all sizes ?
Thanks.
You can specify weight property as follows