Android Navigationdrawer切换汉堡包图标

时间:2015-07-20 12:14:05

标签: android actionbardrawertoggle

我使用android.support.v7.app.ActionBarDrawerToggle作为ActionBarToggle的包,它的构造函数为

mDrawerToggle = new ActionBarDrawerToggle(
                this,
                mDrawerLayout,
                R.string.drawer_open,
                R.string.drawer_close)

如何设置汉堡图标以进行切换?

1 个答案:

答案 0 :(得分:0)

mDrawerToggle = new ActionBarDrawerToggle(
            getActivity(),                    /* host Activity */
            mDrawerLayout,                    /* DrawerLayout object */
            R.drawable.yourIcon,             /* nav drawer image to replace 'Up' caret */
            R.string.navigation_drawer_open,  /* "open drawer" description for accessibility */
            R.string.navigation_drawer_close  /* "close drawer" description for accessibility */
    )