Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActionBar with icon and text in portrait mode

I can't seem to get an image and text to work in portrait mode on menu items in the action bar no matter what I try. I even tried to force android portrait orientation

My XML:

 <item android:id="@+id/menu_save"
  android:icon="@drawable/content"
  android:orderInCategory="100"
  android:title="New Group"
 android:showAsAction="withText|always" />

Has anyone figured this out?

like image 639
Dnaso Avatar asked Apr 20 '13 20:04

Dnaso


1 Answers

From the config.xml file of the native ActionBar:

values:

<bool name="config_allowActionMenuItemTextWithIcon">false</bool>

values-480dp:

<bool name="config_allowActionMenuItemTextWithIcon">true</bool>

To answer your question:

No you can't do that, if the devices width is smaller than 480dp. (Unless you want to create a custom rom with a modded framework)

like image 166
Ahmad Avatar answered Sep 30 '22 15:09

Ahmad