我有以下问题:
我知道如何设置工具栏以显示返回按钮图标,而不是汉堡菜单图标。
从这里:
到这里:
使用:
从这里:
到这里:
我该怎么做?
更新:
我知道如何设置工具栏以显示返回按钮图标,而不是汉堡菜单图标。
从这里:
![enter image description here](https://istack.dev59.com/Sx26a.webp)
![enter image description here](https://istack.dev59.com/dF12T.webp)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
现在,我想要相反的操作,我想从返回按钮图标改为汉堡菜单图标:从这里:
![enter image description here](https://istack.dev59.com/dF12T.webp)
![enter image description here](https://istack.dev59.com/Sx26a.webp)
更新:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayShowTitleEnabled(false);
}
private void enableViews(boolean enable) {
if(enable) {
// Enables back button icon
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} else {
// TODO: Enables burger icon
}
}