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

Posted blfbuaa

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Can a GridView have a footer and header just like ListView?相关的知识,希望对你有一定的参考价值。

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?的主要内容,如果未能解决你的问题,请参考以下文章

E09餐厅Can I have the bill,please?

You can add an index on a column that can have NULL values if you are using the MyISAM, InnoDB, or M

错误记录Flutter 编译报错 ( The parameter ‘‘ can‘t have a value of ‘null‘ because of its type, but the im )(代

bug之needs to have a value for field "id" before this many-to-many relationship can be used

There was a problem connecting to the database server. The following error had occured: Can't co

Can we say objects have attributes, states and behaviors?