开发者

Android ListView Headers

开发者 https://www.devze.com 2022-12-14 18:13 出处:网络
How do you make those standard header labels in the ListView Control? An example would be in the contacts application you see the first letter of the grouped contacts for each letter in the alphabet.

How do you make those standard header labels in the ListView Control?

An example would be in the contacts application you see the first letter of the grouped contacts for each letter in the alphabet.

If possible please provide some code sni开发者_如何学编程ppets on how to construct the grouped data and the display of the ListView.


You can use my MergeAdapter or Jeff Sharkey's SeparatedListAdapter for that.

In the case of MergeAdapter, you would add an ordinary View (e.g., TextView) for a section header, then an Adapter for the contents of that section. Lather, rinse, repeat.

0

精彩评论

暂无评论...
验证码 换一张
取 消