如何在android中创建自定义导航抽屉 [英] How to create a custom navigation drawer in android

查看:39
本文介绍了如何在android中创建自定义导航抽屉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个类似于 gmail 应用导航抽屉的导航抽屉.我关注开发者网站,但它只指定了基本实现.但是我需要根据我的规格自定义导航.

  1. 我需要添加一个标题来对 Drawer 中的列表项进行分类
  2. 我需要一个单选按钮来选择我的一些选项

我该怎么做?

解决方案

教程 可供下载.

<小时>

这也是 可在 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.

这篇关于如何在android中创建自定义导航抽屉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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