且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在android中创建自定义导航抽屉

更新时间:2022-12-11 15:28:38

教程 可供下载.

这也是 可在 GitHub 上找到.

存储库会跟踪对模板所做的更改.

Hi I'm trying to create a navigation drawer similar to gmail app navigation drawer. I follow the developer site but it only specify about basic implementation. But I need to customize the navigation according to my specifications.

  1. I need to add a header to categorize the list item in Drawer
  2. I need a radio button to select some of my options

How can I do this?

The tutorial Android Custom Navigation Drawer (via archive.org) contains a basic and a custom project. The latter shows how to setup a Navigation Drawer as shown in the screenshot:

The source code of the projects (via archive.org) is available for download.


The is also the Navigation Drawer - Live-O project ...

The source code of the project is available on GitHub.


The MaterialDrawer library aims to provide the easiest possible implementation of a navigation drawer for your application. It provides a great amount of out of the box customizations and also includes an easy to use header which can be used as AccountSwitcher.


Please note that Android Studio meanwhile has a template project to create a Navigation Drawer Activity as shown in the screenshot.

This repository keeps track of changes being made to the template.