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
you can find homeview in actionbarview define like this:
but you cannot get upView by findViewById(android.R.id.up).
so you can get homeView and get its parent view ,set upview width 0
ImageView view = (ImageView)findViewById(android.R.id.home);
if(view.getParent() instanceof ViewGroup){
ViewGroup viewGroup = (ViewGroup)view.getParent();
View upView = viewGroup.getChildAt(0);
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) upView.getLayoutParams();
layoutParams.width = 0;
upView.setLayoutParams(layoutParams);
}