ActionBar setDisplayHomeAsUpEnabled(true) vs setDi

2020-02-27 11:03发布

问题:

The title is pretty much self explanatory. What are the exact differences? I'll post sample code below.

actionbar = getSupportActionBar();
actionbar.setDisplayHomeAsUpEnabled(true);
actionbar.setDisplayShowHomeEnabled(true);

回答1:

The documentation is pretty much self explanatory.

ActionBar.setDisplayShowHomeEnabled() specifies whether or not the Home button is shown.

ActionBar.setDisplayHomeAsUpEnabled() specifies whether or not the Home button has the arrow used for Up Navigation next to it.