如何使用子项实现可扩展android导航抽屉? [英] How to implement Expandable android navigation drawer with subitems?

查看:85
本文介绍了如何使用子项实现可扩展android导航抽屉?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何实现这样的android导航抽屉?

How to implement android navigation drawer like this?

TopLevelView1〜TopLevelView4可以选择,没有子级
TopVevelView5可以崩溃

TopLevelView1 ~ TopLevelView4 can select and no children
TopVevelView5 can collaspe

我的问题是,例如我的小组结构是否如此

My question is that if my group structure like this for example

全部
盯着
分类
---- mp3
---- txt
---- doc
---- pdf

All
Stared
Category
----mp3
----txt
----doc
----pdf

当我选择全部然后显示所有文件时.

when I select all then show all file.

当我选择注视然后仅显示注视文件时.

when I select stared then show stared file only.

当我选择mp3时,仅显示mp3文件.

when I select mp3 then show only mp3 files.

和类别可以展开和折叠.

and Category can expand and collapse.

推荐答案

用于导航:

  • 替代1:

滑动菜单,我肯定会喜欢.甚至被诸如LinkedIn和Foursquare之类的流行应用程序所使用,并且易于实现和使用.完整的解释和示例源代码: SlidingMenu-GitHub

Sliding Menu, which I would definitely go with. Even used by popular application like LinkedIn and Foursquare and easy to implement and use. Full explanation and example source codes: SlidingMenu - GitHub

替代2:

Android导航抽屉.如果您想自己完全自定义所有内容而不使用任何库,则可以选择.您可以从Android开发者网站检查代码以及如何执行代码:创建导航抽屉

Android Navigation Drawer. If you want to fully customise everything yourself without using any libraries, this is your option. You can check codes and how to do it from Android Developers website: Creating a Navigation Drawer

在导航抽屉/滑动菜单中查看:

  • 替代1:

Android默认的ExpandableListView.链接: Android开发人员

Android default ExpandableListView. Links: Android Developers , androidhive

替代2:

AnimatedExpandableListView,它是从ExpandableListView实现的,但是当单击一个项目时,将使用平滑的动画进行扩展,您可能希望使用它来获得更好的外观. AnimatedExpandableListView

AnimatedExpandableListView, which is implemented from ExpandableListView, but when an item is clicked, the expand is done with a smooth animation which you may prefer to use for a better look. AnimatedExpandableListView

这篇关于如何使用子项实现可扩展android导航抽屉?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆