创建导航抽屉

时间:2014-10-19 16:27:44

标签: android navigation-drawer

在developer.android培训中,有关于如何创建导航抽屉http://developer.android.com/training/implementing-navigation/nav-drawer.html的探索。 这个tuturial有一个示例应用程序 - > http://developer.android.com/shareables/training/NavigationDrawer.zip

在eclipse中你也可以创建导航抽屉(文件 - > new-> android应用程序项目......->导航抽屉活动)。 在eclipse Navigation Drawer活动中有一个NavigationDrawerFragment类,但在示例应用程序中他们使用ListView

我的问题是为什么示例app和eclipse Navigation Drawer活动如此不同(尽管它们具有相同的功能)? NavigationDrawerFragment类有什么用?为什么要使用Fragement(而不是样本应用程序中的ListView)?

2 个答案:

答案 0 :(得分:0)

我从不使用NavigationDrawerFragment。我认为它很难或等等。如果你想要真正的导航抽屉去这个链接= http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/

答案 1 :(得分:0)

此处您已更新Nav Drawer implementation sample according to Material Design。从Google IO 2015开始,建议使用Android Support Design library,这将使您的生活变得轻松。

相关问题