简体   繁体   中英

Android Navigation Drawer

通过多个活动或在片段的帮助下实现导航抽屉的最佳方法是什么。目前,在多个活动的帮助下,这种正确的做法是吗?

You should use Fragments for android. Its the best way. If you use Fragments you do not have to write the code for providing the functionality of Navigation. Its the most recommended way in android for navigation. Refer the docs .

Navigation Drawer with Fragments is the most recommended approach. It provides lot of flexibility rather than activity. I advise you to implement with Fragments. If you wanna do in standard approach the Fragments are the right and the most correct way. Check the Design Specifications.

Try ActionBarSherlock Navigation Drawer. It will work with API level 8 also. So try this and this link. And you have to work with fragments rather than Activities.

I think I know the problem you are facing and I recommend you to check out this article I've written about the Nav Drawer navigation .

When you have clear on which places you are showing the Drawer then the best way to implement it is using the Android Support Design Library .

When you have different activities where you are showing the Drawer (this could be different hierarchy levels in your app) you'll have to create/reuse a new Drawer on that activity that knows on which activity is in to show as selected that entry on the Drawer.

I don't know if that is exactly your question but hope so.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM