Anthoni wrote:
> Hello,
> 
> I am trying to design a layout where the top half of the screen
> contains a ListView and then aligned at the bottom is an EditText and
> a Button at the side. Now I've got that currently laid out as I want,
> however when the ListView contains more items it displays itself over
> the EditText.
> 
> I am trying to get it so the ListView scrolls it's items but the
> EditText and Button remain stationary. Could someone please have a
> look at my Layout XML and tell me where I am going wrong?
> PS: I am coding for 1.5 version and above.
> 
> Regards
> Anthoni
> 
> <?xml version="1.0" encoding="utf-8"?>
> <RelativeLayout
>         xmlns:android="http://schemas.android.com/apk/res/android";
>         android:orientation="vertical"
>         android:layout_height="wrap_content"
>         android:layout_width="fill_parent">
> 
>         <ListView android:id="@+id/lvReplies"
> android:layout_width="fill_parent"
> android:layout_height="wrap_content"
> android:layout_alignParentTop="true"/>
> 
>         <TableLayout android:layout_width="fill_parent"
> android:layout_height="wrap_content"
> android:layout_alignParentBottom="true" android:stretchColumns="0">
>             <TableRow android:layout_width="fill_parent"
> android:layout_height="fill_parent">
>                 <EditText
>                     android:id="@+id/txtSay"
>                     android:layout_height="wrap_content"
>                     android:layout_width="fill_parent"
>                     android:layout_span="3"
>                     android:singleLine="true"
>                     android:hint="What do want to say to me ?"
>                     />
> 
>                 <Button
>                     android:id="@+id/btnSend"
>                     android:layout_height="wrap_content"
>                     android:layout_width="wrap_content"
>                     android:layout_span="1"
>                     android:text="Send"
>                 />
>             </TableRow>
>         </TableLayout>
> </RelativeLayout>
> 

You do not have any layout rules to force the two widgets not to overlap.

Move your ListView after the TableLayout the RelativeLayout definition
in the XML, and add to it:

android:layout_above="..."

where ... is "@id/whatever_you_decide_to_call_your_table_layout",
because you're going to need to give your TableLayout an android:id
value. That will force it to stay above the TableLayout.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_Beginning Android 2_ from Apress Now Available!

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

Reply via email to