没有操作栏的导航抽屉 [英] Navigation Drawer without Actionbar
问题描述
我搜索了许多站点(也包括 stackoverflow),但无法理解如何在没有操作栏的情况下实现导航抽屉.我知道这里已经有人问过这个问题,但没有正确的解释和代码.我是android开发的初学者,所以任何人都可以用代码向我解释如何制作没有操作栏的导航抽屉
I searched many sites (stackoverflow as well) but couldn't understand how to implement the navigation drawer without the action bar. I know that this question has already been asked here but it doesn't have a proper explanation and code. I am a beginner in android development so can anyone please explain me with code How to make a navigation drawer without an action bar
提前致谢!
推荐答案
只需像@mohan 一样添加你的 DrawerLayout
,然后如果你有一个按钮或你点击的东西想要打开抽屉,就这样做:
Just add your DrawerLayout
like @mohan did, then if you have a button or something you tap on and want to open the drawer, just do like this :
drawer.openDrawer(Gravity.LEFT);
并关闭:
drawer.closeDrawer(Gravity.LEFT);
这篇关于没有操作栏的导航抽屉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!