My problem is that i have a ListView
with a floating action button attached to it. But the FAB hides a button if the list is at the very end. So I want to apply some free space but only to the last item of the list.
I'm using a simple adapter extending the BaseAdapter
. So in getView, I could apply anything to the convertView if position == getCount()-1
.
But how can I make that extra free space?
When I set padding via convertView.setPadding
, to 56dp
the size does not increase, it just hides the elements in my ListView. If I use LinearLayout.Layoutparams
and set margins, nothing happens at all.
So what can I do here?
Set bottom padding to the ListView
itself. You have to set android:clipToPadding="false"
to the ListView
as well.
as well as Egor's approach, you can also use ListView.setFooterView(View v)
to an inflated view that's as tall as your fab.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With