• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
chen young
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

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

Thanks
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
chen young
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks

I got it
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic