取出抽屉式导航栏图标,并使用应用程序图标来打开 [英] Remove the navigation drawer icon and use the app icon to open

查看:207
本文介绍了取出抽屉式导航栏图标,并使用应用程序图标来打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要删除的小抽屉式导航栏图标,打开动作条图标点击左侧面板。我怎样才能做到这一点?

I want to remove the small navigation drawer icon and open the left panel on actionbar icon click. How can I do this?

其实我喜欢创建Pinterest的的一个动作条

Actually I'm creating an Actionbar like Pinterest's

推荐答案

如果你想摆脱 DrawerLayout 指示灯不使用 ActionBarDrawerToggle 。要切换 DrawerLayout 当您选择动作条家启示通话 DrawerLayout.openDrawer DrawerLayout.closeDrawer 根据当前的状态。

If you want to get rid of the DrawerLayout indicator don't use the ActionBarDrawerToggle. To toggle the DrawerLayout when you select the ActionBar home affordance call DrawerLayout.openDrawer and DrawerLayout.closeDrawer depending on the current state.

switch (item.getItemId()) {
        case android.R.id.home:
            if (mDrawerLayout.isDrawerVisible(GravityCompat.START)) {
                mDrawerLayout.closeDrawer(GravityCompat.START);
            } else {
                mDrawerLayout.openDrawer(GravityCompat.START);
            }
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }

另外,从我可以告诉Pinterest的不使用 DrawerLayout

这篇关于取出抽屉式导航栏图标,并使用应用程序图标来打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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