right now i have a list view that populates like
[top]
1
2
3
4
[bottom]
I want it to populate like
[top]
4
3
2
1
[bottom]
. android:stackFromBottom="true"
is not giving me what i want
right now i have a list view that populates like
[top]
1
2
3
4
[bottom]
I want it to populate like
[top]
4
3
2
1
[bottom]
. android:stackFromBottom="true"
is not giving me what i want
override getItem
and instead of returning the data set entry at position
, return the entry at dataset.size() - position - 1
. E.g
Assuming the dataset is composed of String
s, and you are storing those in an ArrayList<String>()
called mDataSet
@Override
public String getItem(int position) {
return mDataSet.get(dataset.size() - position - 1);
}
Refer to this: Is it possible to make a ListView populate from the bottom?
It only works if the ListView's width and height are set to match_parent or fill_parent.