Use `android:layout_alignParentTop="true"` in TextView , `android:layout_alignParentBottom="true"` in LinearLayout and
android:layout_above="@+id/cont"
android:layout_below="@+id/textView2" in ListView
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="ComplianceNames"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ListView
android:id="@+id/selectedComplianceList"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_above="@+id/cont"
android:layout_below="@+id/textView2"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:clipToPadding="false"
android:divider="@null"
android:dividerHeight="6dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" />
<LinearLayout
android:id="@+id/cont"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_marginLeft="10dp"
android:layout_marginTop="3dp"
android:orientation="vertical" >
<Button
android:id="@+id/submit_area"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:layout_marginTop="5dp"
android:padding="5dp"
android:text="Submit" />
</LinearLayout>
</RelativeLayout>
Like answer of [@Manoj Seelan][1]
Replace `android:layout_weight` With `android:weight`.
When you use **Weight** with `LinearLayout`. you must add `weightSum` in `LinearLayout` and according to orientation of your `LinearLayout` you must setting `0dp` for Width/Height to all `LinearLayout`\`s Children views
Example :
**If** The orientation of `Linearlayout` is `Vertical` , then Set Width of all `LinearLayout`\`s Children views with `0dp`
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="3">
<Button
android:text="Register"
android:id="@+id/register"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="10dip"
android:layout_weight="2" />
<Button
android:text="Not this time"
android:id="@+id/cancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="10dip"
android:layout_weight="1" />
</LinearLayout>
**If** the orientation `Linearlayout` of is `horizontal` , then Set Height of all `LinearLayout`\`s Children views with `0dp`.
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3">
<Button
android:text="Register"
android:id="@+id/register"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:padding="10dip"
android:layout_weight="2" />
<Button
android:text="Not this time"
android:id="@+id/cancel"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:padding="10dip"
android:layout_weight="1" />
</LinearLayout>
[1]: https://stackoverflow.com/a/12392771/1908296