Georgi Angelov
Georgi Angelov

Reputation: 4388

Hide ActionBar icon but keep title

So I am trying to remove the icon from the actionbar but at the same time keep the Title. The problem is that I can only keep both or none at all.

I tried using:

actionBar.setDisplayShowTitleEnabled(true);
actionBar.setTitle("My title");
actionBar.setDisplayUseLogoEnabled(false);

but this does not hide the logo.

If I want to hide the logo I need to hide both the title and the logo.. Any suggestions?

Upvotes: 0

Views: 299

Answers (2)

JpCrow
JpCrow

Reputation: 5077

Try with this:

   getActionBar().setIcon(new ColorDrawable(getResources().getColor(android.R.color.transparent)));    

Upvotes: 0

user3462253
user3462253

Reputation: 156

you can use setIcon(null) to get rid of it

Upvotes: 1

Related Questions