This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Android and the fly likes How to add button at the end of the screen (after the ListView) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "How to add button at the end of the screen (after the ListView)" Watch "How to add button at the end of the screen (after the ListView)" New topic
Author

How to add button at the end of the screen (after the ListView)

chen young
Ranch Hand

Joined: Sep 09, 2005
Posts: 192
Hi

How can I a button at the end of the screen (after the ListView)
What layout should I use ?

Thanks
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

There are many ways to do this;

1. Assuming that you have only a ListView and a button to display in your activity. Say you use LinearLayout; you can set the layout_weight of the ListView to "1" and then have the button below the ListView.
2. If you are using RelativeLayout you can use align_parentBottom property to place the button at the bottom of its parent


[List of FAQs] | [Android FAQ] | [Samuh Varta]
chen young
Ranch Hand

Joined: Sep 09, 2005
Posts: 192
Sorry but I don’t understand how to have the button the ListView ?
Can you please show example

My main.xml:



chen young
Ranch Hand

Joined: Sep 09, 2005
Posts: 192
Sorry but I don’t understand how to have the button the ListView ?
Can you please show example

My main.xml:



chen young
Ranch Hand

Joined: Sep 09, 2005
Posts: 192
Thanks

I got it
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to add button at the end of the screen (after the ListView)