如何在 Android 中创建树视图?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1944961/
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
How to create a tree view in Android?
提问by Samuh
There are no controls in Android that provide Tree-like View. There is an ExpandableList View which I suspect could be used to creating one.
Android 中没有提供树状视图的控件。我怀疑有一个 ExpandableList 视图可以用来创建一个视图。
Have you tried imlpementing such a control? How would one implement such a control in Android?
您是否尝试过实施这样的控制?如何在 Android 中实现这样的控件?
采纳答案by Jarek Potiuk
Our company just open-sourced a small widget that is doing just that... You can see all the sources and add the project (as a library) to your own android project:
我们公司刚刚开源了一个小部件,它就是这样做的……您可以查看所有源代码并将项目(作为库)添加到您自己的 android 项目中:
回答by blacharnia
take a look at ExpandableListView. Besides, see following thread:
看看 ExpandableListView。此外,请参阅以下线程:
回答by lancha90
this solutions are, very complicate. but can use a ExpandableListView of more levels.
这种解决方案非常复杂。但可以使用更多级别的 ExpandableListView。
Example: How to implement multilevel ExpandableListview in Android?