I want to remove the padding around the icon on the left in the standard android 4.0+ action bar. I\'m setting the icon with:
getActionBar().setIcon(getResou
use custom layout for ActionBar
public class TestActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final ActionBar actionBar = getActionBar();
actionBar.setCustomView(R.layout.actionbar_custom_view_home);
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowCustomEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setDisplayShowHomeEnabled(false);
setContentView(R.layout.main);
}
public void Click(View v) {
if (v.getId() == R.id.imageIcon) {
Log.e("click on--> ", "Action icon");
}
}
}
actionbar_custom_view_home.xml