I have a requirement for my Android application that the button is at the bottom of the list. This is done specifically so that users can scroll through the entire list (and possibly see more answers). So I added a button as a list footer.
All this works fine, but in some cases the list is too short (only 3-4 items), so the button will be displayed approximately in the middle of the screen. I would like the button to be at the end of the list (therefore, if there are enough elements in the list, the user can only see the button when scrolling down), but when the list contains only a few elements, the button will fix itself at the bottom of the screen.
To give an idea, I want:
onCreate() { if (button.getyposition() > screen.getyposition()) {
The fact is, I donβt know if and where to start. Can someone give me some guidance on where to look for or even better sample code? Thanks in advance!
EDIT:
I added a picture to clarify my problem. Hope this makes sense!
Image showing the button halfway on the screen http://niles11.dyndns.org/example.png
As you can see, this looks pretty weird with a button half on the screen. I want the button to be at the bottom of the BUT screen (!), When the list contains more elements I want them to appear at the bottom of the list (so turn off the screen first)
Hope this picture helps!
source share