I have to make a layout where in the first row I have a heading and below it, there is listview. The heading should be placed left align and the listview should be match the total width. For this, I am using the following xml.
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/splashContent"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="#7A0225"
android:orientation="vertical" >
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="top|left"
android:layout_weight="0"
android:background="@drawable/search_bg_row1">
<TextView
android:id="@+id/pcomparetitle"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingBottom="4dp"
android:paddingLeft="10dip"
android:paddingRight="0dip"
android:paddingTop="10dp"
android:text="Price Comparison for ISBN: "
android:textColor="#FFFFFF"
android:background="#00FF00"
android:textSize="15sp"
android:textStyle="bold" >
</TextView>
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center_vertical|left"
android:background="@drawable/search_bg_row3">
<ListView
android:id="@+id/pricelist"
android:background="#FF0000"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ListView>
</TableRow>
</TableLayout>
Now, the Listview is taking the width the same of the heading. As the heading is short in comparison with the width of higher resolution display, the listview is taking partial width. How to solve this problem?