Text does not display with icons in portrait mode on SherlockActionBar

I have a question regarding the sherlock action bar. In portrait mode, ICS does not display text next to menu items in the action bar, regardless of how much space is available. Turning to landscape mode gives the expected behavior (icons + text). If I remove the icon from the menu item, it will display the text (only) in portrait mode. Is it possible to display the text icon + in portrait mode if space is available? I use the following code to add menu items to the action bar.

@Override public boolean onCreateOptionsMenu(Menu menu) { menu.add(Menu.NONE, 1, 0, "Post").setTitle("Post").setIcon(android.R.drawable.ic_menu_save).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT); return true; } 

Thanks in advance.

+7
source share
1 answer

From https://github.com/JakeWharton/ActionBarSherlock/issues/400 :

You will never see the icon and text on small images on any screen with a width of less than 480dp. This rule is from your own action bar.

So, no, it is not possible on smaller screens, even if there is room in the action bar. As you have already indicated, you can drop the icon so that the text appears.

+6
source

All Articles