ListView overlapping bottom view

by Jose Gomez » Mon, 26 Apr 2010 02:56:15 GMT


Sponsored Links
 Hello all,

I have the following layout, which gives me a header, a list view and a
footer it looks good but when the listview's contents are greater than
wheere the bottom textview start its basically overlays the list on top of
it. I was the listview to not overlay on top of the footer Any help is
greatly appreaciated

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
xmlns:android=" http://schemas.android.com/apk/res/android" ;
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@drawable/groshielogo"
</ImageView>
<TextView
android:id="@+id/lbl_goshopping_aisle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:text="Aisle 1"
android:textSize="25sp"
android:textStyle="bold"
android:layout_gravity="center_horizontal"
</TextView>
<RelativeLayout
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_centerHorizontal="true">
<ListView
android:id="@+id/lst_goshoppingList"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
</ListView>
<TextView
android:id="@+id/lbl_goshopping_footer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:text="Aisle 1"
android:textSize="25sp"
android:textStyle="bold"
android:layout_gravity="center_horizontal"
android:layout_alignParentBottom="true"

/>
</RelativeLayout>
</LinearLayout>



Sincerely
Jose C Gomez

 http://www.josecgomez.com 

--



ListView overlapping bottom view

by Andrey Mandychev » Fri, 28 May 2010 03:52:12 GMT


 


Hi,
I had the same problem but the solution was found in List7 example
from ApiDemos. Below is the XML snippet:

<LinearLayout xmlns:android=" http://schemas.android.com/apk/res/ 
android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:paddingLeft="8dip"
        android:paddingRight="8dip">

        <ListView android:id="@android:id/list"
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="1"
            android:drawSelectorOnTop="false"/>

    <TextView android:id="@+id/phone"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/blue"/>

</LinearLayout>

--


Sponsored Links