Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Home Icon in Action Bar Sherlock

I am trying to set custom icon for home icon using ActionBarSherlock library. I have tried to set custom layout using abHomeLayout attribute in my custom theme. But it didn't work for me. Only way, how to set it, is to set abIcon attribute for my custom drawble, but I cannot set some horizontal padding for this drawable. Is there any example for this or where could be a problem with abHomeLayout attribute?

like image 772
sealskej Avatar asked Oct 31 '11 12:10

sealskej


1 Answers

This works for my situation, it replaces the default ic_launcher icon in the action bar with my custom one.

In your onCreate do this:

getSupportActionBar().setIcon(R.drawable.audio_shortcut); 

Or in the manifest you can set the logo:

<activity>     android:logo="@drawable/my_custom_logo"     ... </activity> 
like image 184
Matthew Avatar answered Oct 06 '22 00:10

Matthew