码迷,mamicode.com
首页 > 其他好文 > 详细

Can a GridView have a footer and header just like ListView?

时间:2017-07-26 23:41:38      阅读:263      评论:0      收藏:0      [点我收藏+]

标签:ucid   androi   class   targe   mono   pac   round   and   photo   

Aquick question:

In ListView I use this code:

list.addHeaderView(headerView);

How to deal with it when working on gridview?

Thanks.


There is a quite good implementation of GridView with header support in Google Photos application, as it‘s OSS code you can use it as is or take it as a reference for your own implementation:http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.3_r2.1/com/android/photos/views/HeaderGridView.java

Basic idea is quite simple - WrapperAdapter creates an fake row by increasing number of items by number of columns and then return a header view for the item.


original text:http://stackoverflow.com/questions/5790215/can-a-gridview-have-a-footer-and-header-just-like-listview

answered Jan


Can a GridView have a footer and header just like ListView?

标签:ucid   androi   class   targe   mono   pac   round   and   photo   

原文地址:http://www.cnblogs.com/blfbuaa/p/7242127.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!