Hey so i tried the first solution u suggested but i got an error
basically all i have is one layout file and i call it using
setListAdapter(new ArrayAdapter<String>(this, R.layout.next, names));
names is already defined then for the layout file and i suppose to
delete some stuff
for either the listview or button cuz when i ran it, i got a force
close? and basically i just added the stuff u talked about on the
bottom of
both the listView and button and then ran itso i wasnt sure if i was
suppose to delete anything else like layout width hieght
<ListView
android:id="@+id/ListView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_above="@+id/whatever_you_decide_call_your_button"
>
</ListView>
<Button
android:text="@+id/Button01"
android:layout_below="@+id/ListView01"
android:id="@+id/Button01"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentBottom="true"
>
</Button>
On Oct 21, 10:52 am, Mark Murphy <[email protected]> wrote:
> TreKing's solution works if you want the Button to scroll with the
> rest of the contents of the ListView. If you want the Button to stay
> fixed on the bottom of the screen:
>
> Step #1: Create a RelativeLayout
>
> Step #2: Put the ListView and the Button in the RelativeLayout
>
> Step #3: Anchor the Button to the bottom of the RelativeLayout using
> android:layout_alignParentBottom="true"
>
> Step #4: Fill the rest with the ListView using
> android:layout_alignParentTop="true" and
> android:layout_above="@+id/whatever_you_decide_call_your_button"
>
> Or:
>
> Step #1: Create a LinearLayout
>
> Step #2: Put a ListView in the LinearLayout with
> android:layout_height="0px" and android:layout_weight="1"
>
> Step #3: Put a Button after the ListView in the LinearLayout with no
> android:layout_weight attribute
>
> On Thu, Oct 21, 2010 at 1:46 PM, Gabriel Huie <[email protected]> wrote:
> > Hi I wanted to know how to create a listActivity on Droid but on the
> > bottom have a bottom to do whatever i want so like in a section of its
> > own. Recently i tried merging two layouts with one being the row one
> > for list Activity and a button but all i get are a list with buttons
> > next to each line on the list so how can we do a list with a space on
> > the bottom just for a button?
>
> --
> Mark Murphy (a Commons
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android App Developer Books:http://commonsware.com/books
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en