在应用程序子菜单 [英] Sub Menu in App
问题描述
是具有一个子菜单,可以在Android的?
Is having a sub menu possible in Android?
和你怎么称呼这种观点在Android的?
And what do you call this view in Android?
推荐答案
正如其他人所说,这是一个的 ExpandableListView
,一个的 NavigationDrawer
。还有一些教程,你可以使用(见下面我的列表)。
As others have mentioned, this is an ExpandableListView
, within a NavigationDrawer
. There are several tutorials you can use (see my list below).
根据个人经验给你一句忠告:对于 SimpleExpandableListAdapter
是pretty的限制,往往不是你要找的东西在你的定制。如果你想拥有自己的特定行为,外观和感觉的子菜单,我强烈建议考虑延长的 BaseExpandableListAdapter
自己和创建自己的自定义适配器。 [这似乎令人生畏在第一,但它不是非常难,一旦你有你的菜单和子菜单(S)内抓你的父母和孩子。]
One piece of advice based on personal experience: the baseline behavior for the SimpleExpandableListAdapter
is pretty limiting and often not what you're looking for in your customization. If you're looking to have your own specific behavior and look-and-feel to the sub menus, I highly recommend looking into extending the BaseExpandableListAdapter
yourself and creating your own custom adapter. [This may seem daunting at first, but it's not terribly hard once you have a grasp on your parents and children within your menu and sub menu(s).]
- 在神奇的示例项目创建自定义适配器: https://github.com/tjerkw/Android-SlideExpandableListView一>
- 在另一篇文章在这里讨论这样的:<一href="http://stackoverflow.com/questions/18496843/android-expandable-navigation-drawer-with-custom-row-views">Android:扩展导航抽屉与自定义行的观点
- 示例
ExpandableListAdapter
(因为如果创建自己的更好的理解):的 http://blog.denevell.org/android-SimpleExpandableListAdapter-example.html - 在创建自己的
ExpandableListAdapter
: http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/
- Fantastic example project creating custom adapter: https://github.com/tjerkw/Android-SlideExpandableListView
- Another article here discussing this: Android: Expandable Navigation Drawer with custom row views
- Example
ExpandableListAdapter
(for better understanding if creating your own): http://blog.denevell.org/android-SimpleExpandableListAdapter-example.html - Creating your own
ExpandableListAdapter
: http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/
这篇关于在应用程序子菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!