如何使用ActionBarDrawerToggle v7和工具栏v7更改android中不同片段的汉堡包图标

时间:2016-03-23 11:19:16

标签: android android-actionbar fragment navigation-drawer hamburger-menu

它采用汉堡包中的导航默认图标(灰色图标)。

mDrawerToggle=new ActionBarDrawerToggle(MainActivity.this,mDrawerLayout,toolbar,R.string.drawer_open,R.string.drawer_open)
    {
        @Override
        public void onDrawerClosed(View drawerView) {
            super.onDrawerClosed(drawerView);

            invalidateOptionsMenu();
            mDrawerLayout.setDrawerListener(mDrawerToggle);
            mDrawerList.smoothScrollToPosition(0);
            isItemClicked = false;
        }

    };

    mDrawerLayout.setDrawerListener(mDrawerToggle);
    mDrawerList.setOnItemClickListener(new SlideMenuClickListener());
}

0 个答案:

没有答案