如何隐藏导航视图android的默认汉堡包图标 [英] How to hide default hamburger icon of Navigation view android

查看:244
本文介绍了如何隐藏导航视图android的默认汉堡包图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要隐藏汉堡包图标

这是我的工具栏

我需要隐藏导航栏的默认汉堡图标并从另一个按钮单击中加载它.导航栏需要出现在附件图标中,然后在我的工具栏中单击,当我在外面(任何地方)单击时都需要消失.完成吗?

I need to hide the default hamburger icon of navigation bar and load it from another button click.The navigation bar need to appear on the attachment icon click in my toobar and need to disappear when i click outside(anywhere).Can this be done ?

推荐答案

如果您使用的是ActionBarDrawerToggle,则可以添加一行

if you are using ActionBarDrawerToggle then you can add a line

toggle.setDrawerIndicatorEnabled(false);

打开和关闭可在点击事件中编写的抽屉

and opening and closing drawer you can write in your click event

if (drawer.isDrawerOpen(GravityCompat.START)) {
    drawer.closeDrawer(GravityCompat.START);
} else {
    drawer.openDrawer(GravityCompat.START);
}

这篇关于如何隐藏导航视图android的默认汉堡包图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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