Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to make a ListView populate from the bottom?

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?

like image 910
osweetman Avatar asked Apr 03 '12 05:04

osweetman


People also ask

How do I create a custom list view?

What is custom listview? Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.

Is ListView a ViewGroup?

BaseAdapter with Android ListView. ListView is a ViewGroup that displays a list of vertically scrollable items. The list items are automatically inserted into the list using an adapter that is connected to a source, such as an array or a database query, and each item is converted into a row in the ListView.

How pass data from ListView to another activity in Android?

Implement ListView 's OnItemClickListener, once you handle this event, try to get the location of the row that was clicked. Once you get it, access that particular row position in the source array (or whatever else you're having). This way, you'll have the data that you want to pass to another activity.


1 Answers

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.

like image 134
Joe Avatar answered Oct 06 '22 00:10

Joe