在应用程序子菜单 [英] Sub Menu in App

查看:195
本文介绍了在应用程序子菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是具有一个子菜单,可以在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).]

  • 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屋!

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