Give the second RelativeLayout an id (for instance
android:id="@+id/footer") and then on your ListView use:

android:layout_height="0dip"
android:layout_alignParentTop="true"
android:layout_above="@id/footer"

On Tue, Feb 17, 2009 at 1:50 PM, dds <spen...@deepdarksee.com> wrote:
>
> I'm displaying a ListView with a view containing a button anchored at
> the bottom of the screen below it.  Whether I use fill_parent or
> wrap_content for the height of the ListView, it still extends down
> behind the 'footer' at the bottom of the screen (which makes sense,
> thinking about what they mean).
>
> I was thinking I could programatically use getHeight() against the
> 'footer', and then set the height of the ListView after getting the
> screen height and doing the math.  I don't see how to programatically
> set that ListView height after the layout has inflated.
>
> Any pointers?  Layout is below.
>
> Thanks!
> dds
>
> <?xml version="1.0" encoding="utf-8"?>
> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
> android:layout_width="fill_parent"
> android:layout_height="fill_parent"
> android:orientation="vertical"
>>
> <ListView xmlns:android="http://schemas.android.com/apk/res/android";
> android:id="@+id/list"
> android:layout_width="fill_parent"
> android:layout_height="wrap_content"
>>
> </ListView>
> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
> android:layout_width="fill_parent"
> android:layout_height="50sp"
> android:layout_alignParentBottom="true"
> android:background="#676767"
> android:orientation="vertical"
>>
>        <Button xmlns:android="http://schemas.android.com/apk/res/android";
>        android:id="@+id/closebutton"
>        android:layout_width="120sp"
>        android:layout_height="wrap_content"
>        android:layout_centerHorizontal="true"
>        android:layout_alignParentBottom="true"
>        android:text="@string/ui_contact_list_close_str"
>        />
> </RelativeLayout>
> </RelativeLayout>
>
> >
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to