如何更改回默认工具栏navigationicon

时间:2015-06-17 23:33:51

标签: android navigation toolbar

使用

更改工具栏navigationicon后
toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha);

我无法继续工作切换回默认(汉堡)图标:

int[] attrs = {android.R.attr.navigationIcon};
TypedArray ta = myContext.obtainStyledAttributes(attrs);
Drawable drawableFromTheme = ta.getDrawable(0 /* index */);
toolbar.setNavigationIcon(drawableFromTheme);
ta.recycle();

0 个答案:

没有答案