2

Problem

Until 4.1.2 version, the action bar menu item with icon size is correct (attach 1)

enter image description here

with the upgrade to 4.3 version what is shown is the following (attach 2)

enter image description here

Code

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    menuItemLogout = menu.add(0, MENUITEM_LOGOUT_ID, 0, "LOGOUT").setIcon(R.drawable.iv_logout);

    menuItemLogout.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
    return true;
}

The icon

I attach the icon 85x48 painted with black so you can see it:

enter image description here

Links and considerations

I already have checked the following links without clearing my issue:

Icons in menu are smaller than they should be

Action bar icon size in Android 4.2 (I have not tried this solution... too hacky)]

Android dev - Iconography#actionbar

It seems that some kind of padding is applied to the icon, or the button is not correctly resized, depending on the icon size.

Community
  • 1
  • 1
Link 88
  • 553
  • 8
  • 27

0 Answers0