I have a simple application which basically consists of a line of buttons and a ListView of items to be selected and manipulated. There might be only one item in the list or a few. However, I would prefer if the list would populate from the bottom of the ListView, since the way most people hold their phones makes it easier to select items closer to the bottom of the screen. Is this possible?
Asked
Active
Viewed 2.1k times
45
-
what exactly you want. if im not wrong suppose you have three items 1,2,3 then your list with must comtain 3,2,1 thats it or not – Shankar Agarwal Apr 03 '12 at 05:07
-
You wanna display your content from bottom in listivew, is it? – RobinHood Apr 03 '12 at 05:22
4 Answers
125
You can have the ListView
stack its items from the bottom up using a simple XML property
under the xml -
<ListView
android:stackFromBottom="true"
...
></ListView>
Please read @The Berga answer to otherwise this won't work.
-
i want to show list from top to bottom, and you answer helped me alot i get the idea from where i can changed it.. Thnks man... – robinHood013 Nov 30 '15 at 12:03
19
Joe answer is correct but it's important to point out that it only works if the ListView
's width and height are set to match_parent
or fill_parent
.
If set to wrap_content
it still will populate from top to bottom.

The Berga
- 3,744
- 2
- 31
- 34
0
I tried android:stackFromBottom="true"
with android:layout_width="match_parent"
android:layout_height="fill_parent"
but it didn't work
finally
Adapter.insert(post,0);
saved my day. Here post is the class which is returning data to be added

nakul parashar
- 89
- 6
0
These are a must tags for the reverse populating of the list view.
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stackFromBottom="true"
</ListView>

Jacob Janga
- 39
- 1