Anushka Agarwal
Anushka Agarwal

Reputation: 127

Set image in action bar

I have set image in Actionbar using

ActionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.header));

and also removed "android:icon="@drawable/header" from manifest.xml

but I am getting one image overlapped over other. I am attaching snapshot.

enter image description here

I want to display only my image.

Upvotes: 1

Views: 3099

Answers (2)

Palash Agrawal
Palash Agrawal

Reputation: 191

getActionBar().setDisplayShowHomeEnabled(false);

add this in your code you will get the desired output!!!

Upvotes: 1

Sagar Pilkhwal
Sagar Pilkhwal

Reputation: 3993

Use this code:

getActionBar().setIcon(android.R.color.transparent);

Upvotes: 1

Related Questions