I have been keeping searching for a long time for a GridView which allows us to addFooterView
and addHeaderView
like ListView
.
It's a post 2 years ago. I come here by following the link in google search result. I don't know weather this problem has been solved or not.
If not, here is a library which may be helpful. https://github.com/liaohuqiu/android-GridViewWithHeaderAndFooter.
It's very simple:
GridViewWithHeaderAndFooter gridView = (GridViewWithHeaderAndFooter) v.findViewById(R.id.ly_image_list_grid);
LayoutInflater layoutInflater = LayoutInflater.from(this);
View headerView = layoutInflater.inflate(R.layout.test_header_view, null);
View footerView = layoutInflater.inflate(R.layout.test_footer_view, null);
gridView.addHeaderView(headerView);
gridView.addFooterView(footerView);
Here is a screen snapshot:
Hope this would be helpful. Good luck!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…