问题
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.
I want to display only my image.
回答1:
getActionBar().setDisplayShowHomeEnabled(false);
add this in your code you will get the desired output!!!
回答2:
Use this code:
getActionBar().setIcon(android.R.color.transparent);
来源:https://stackoverflow.com/questions/25911910/set-image-in-action-bar