如何在 Android 中将标题添加到列表视图

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10730445/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 04:47:20  来源:igfitidea点击:

How to add Header to List View In Android

androidheaderviews

提问by AmyWuGo

Just as title... I am new. Could someone give me some easy examples, Thank you!

正如标题...我是新来的。谁能给我一些简单的例子,谢谢!

采纳答案by CMA

Some of the examples are:

一些例子是:

  1. Android ListView Example

  2. ListView with headers above sections

  1. Android ListView 示例

  2. 带有标题的 ListView 部分上方

AND it's important to read the APIfirst.

首先阅读API很重要。

if you like to have another example, a simple google search would do. :)

如果你想再举一个例子,一个简单的谷歌搜索就可以了。:)

回答by Ram kiran

There are so many ways of adding Headersto list view

标题添加到列表视图的方法有很多种

  1. For Sticky Header, check this.

  2. For Android Categorized listview with heading, check this this.

  3. You can find source code at this

  4. For android-amazing-listview, check this

  1. 对于粘性标题,请检查

  2. 对于带有标题的 Android 分类列表视图,请检查这个

  3. 您可以在找到源代码

  4. 对于 android-amazing-listview,检查这个

These are the examples of Different types of list view.

这些是不同类型列表视图的示例。