I add a FooterView
in a ListView
, But when i set the view's visibility to be GONE
, just the content of the view is hided. I means it leaves space in the ListView
, just like the INVISIBLE
.
How can I set the FooterView
to be GONE
.
Asked
Active
Viewed 312 times
2
-
can you please share your code – user Aug 17 '12 at 08:01
-
I think you should user listView.removefooterView http://developer.android.com/reference/android/widget/ListView.html#removeFooterView%28android.view.View%29 – nandeesh Aug 17 '12 at 08:10
-
I have got a method, when i set the height of childView's layoutParams to 0, it working OK. – TaoZang Aug 17 '12 at 09:27
1 Answers
1
You can remove the footer like this:
listView.removeFooterView(view);

Andy Res
- 15,963
- 5
- 60
- 96
-
That wouldn't help for two reasons: firstly, headers and footers are supposed to be added *before* you set the adapter (so the view can wrap the adapter cursor with the header and footer views) and secondly, if you have multiple headers or footers and you wanted to add one back, it would be put on the end of the list, not in its original position. – Andrew Wyld Oct 29 '13 at 11:57