Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 使用ActionBarDrawerToggle和appcompat v7更改导航抽屉homeAsUpIndicator_Android_Android Actionbar_Navigation Drawer - Fatal编程技术网

Android 使用ActionBarDrawerToggle和appcompat v7更改导航抽屉homeAsUpIndicator

Android 使用ActionBarDrawerToggle和appcompat v7更改导航抽屉homeAsUpIndicator,android,android-actionbar,navigation-drawer,Android,Android Actionbar,Navigation Drawer,我正试图改变我的动作条的主指示灯。现在,打开时显示箭头,关闭时显示3条条纹: 我想用定制的可拉伸箭头替换此箭头。下面的代码不起作用: getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setLogo(getResources().getDrawable(R.drawable.

我正试图改变我的动作条的主指示灯。现在,打开时显示箭头,关闭时显示3条条纹:

我想用定制的可拉伸箭头替换此箭头。下面的代码不起作用:

getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeButtonEnabled(true);
    getSupportActionBar().setLogo(getResources().getDrawable(R.drawable.actionbar_logo));
    getSupportActionBar().setDisplayUseLogoEnabled(true);

    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerToggle = new ActionBarDrawerToggle(
            this,                  /* host Activity */
            mDrawerLayout,         /* DrawerLayout object */
            R.string.app_name,  /* "open drawer" description for accessibility */
            R.string.app_name  /* "close drawer" description for accessibility */
    ) {
        public void onDrawerClosed(View view) {
            //getActionBar().setTitle(mTitle);
            //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
        }

        public void onDrawerOpened(View drawerView) {
            //getActionBar().setTitle(mDrawerTitle);
            //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
        }
    };
    mDrawerToggle.setHomeAsUpIndicator(getResources().getDrawable(R.drawable.actionbar_logo));
    mDrawerLayout.setDrawerListener(mDrawerToggle);
如果我在样式中使用useLogo | showHome | showTitle,它将显示除原始homeAsUpIndicator之外的自定义绘图,而我想要的是替换它


我怎样才能做到这一点?谢谢

@MikeM。不,我在用…@MikeM。好的,我已经将其更改为工具栏,但setNavigationIcon仍然无效。setLogo也不能代替后排的车。。。我打赌ActionBarDrawerToggle会以某种方式覆盖它。我希望我能找到一个同时实现toolbar、navigation drawer和support.v7的示例……你有什么解决方案吗?