GridView 没有addFooterView,用第三方 GridViewWithHeaderAndFooter
使用方法:
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);
下载地址:
https://github.com/liaohuqiu/android-GridViewWithHeaderAndFooter