开发者

How do I group similary items in an Android ListView?

开发者 https://www.devze.com 2023-03-10 08:43 出处:网络
I\'m building an app that lists items in a ListView.There are a lot of items, and I\'d like to present the user with a tree-like view that groups similar items (e.g. produce) under a parent category a

I'm building an app that lists items in a ListView. There are a lot of items, and I'd like to present the user with a tree-like view that groups similar items (e.g. produce) under a parent category and expands to show the user the specific items (e.g. lettuce, tomato) after the user clicks on the category (e.g. produce). Is the ListView the right view to use? If so, how do I do this?

开发者_开发知识库

Thanks!


You want to use an ExpandableListView.

Here is an example on the Android Developer website.

0

精彩评论

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

关注公众号