I want to remove the left arrow from the action bar and only icon and title needed.
My code:
getSupportActionBar().setIcon(R.drawable.logo);
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setTitle(R.string.dashboardtitle);
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
But this doesn't remove the left arrow . Any help!!
You need to add this to your actionBar theme. You can replace arrow image with your own image which can be transparent
Where action_arrow is a 25x10px transparent png. Same code for sherlock would be:
In AndroidManifest.xml
remove the below code, which will remove back button from your ActionBar
Just keep it like below:
@vivek: works great. I do not recommend to use @android:color/transparent as Tim Cooper said, because the Title is aligned to the left. So a empty image is better
According to specification android specification: To enable the icon for up navigation (which displays the "up" indicator next to the icon), call setDisplayHomeAsUpEnabled(true) on your ActionBar:
So you should set actionBar.setDisplayHomeAsUpEnabled(false);
UPDATE: I test next code with ActionBar sherlock and it's work. There is no back arrow: