manhtuan21
manhtuan21

Reputation: 3475

How to hide ActionBar but still show Navigation menu icon on top left

I try to hide ActionBar in Navigation View by using getSupportActionBar().hide() but it makes menu icon on top left dissapear too, like this : enter image description here

I want it show like this :

enter image description here

Could someone give me some advice ?

Upvotes: 0

Views: 144

Answers (3)

manhtuan21
manhtuan21

Reputation: 3475

I have just done it,for anyone need it, just create an ImageView and handle click event with this:

DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
drawerLayout.openDrawer(Gravity.LEFT);

Upvotes: 0

Sudipta Basak
Sudipta Basak

Reputation: 178

Add a ImageButton and fix it's position to top left corner . And handle the click event of the button using OnClickListner ... Simple ...

Upvotes: 0

Liar
Liar

Reputation: 1255

No, you can't because the icon is part of ActionBar. You can create ImageView (or Button, ...) and place it at the top-left position and handle click event or use transparent ToolBar

Upvotes: 1

Related Questions