getSupportActionBar().setHomeAsUpIndicator(newDrawerArrowDrawable(getApplicationContext()));
ToolBar 默认的返回键是<-这样的箭头,要想修改的话可以使用ToolBar.setNavigationIcon(id 或 Drawable) 方法来修改,不过是无法达到我想要的三条横线的要求。
所以在观察了DrawableLayout 侧滑菜单和ActionBarDrawerToggle的源码后,发现只要
new ActionBarDrawerToggle( this, new DrawerLayout(this), null, 0, 0).syncState();
就可以刷新 变成
这样的效果。但是这还是不好用。
经过寻找getSupportActionBar().setHomeAsUpIndicator(new DrawerArrowDrawable(this);
这一句话就可以实现 上面的效果,但是
黑色的,
把上面的this改成getApplicationContext() 后完成
getSupportActionBar().setHomeAsUpIndicator(new DrawerArrowDrawable(getApplicationContext()));
不知道为什么,写this 或者activcity.this无法获取到主题,导致图片颜色为默认的黑色。