10

Is that possible to define a text which to be shown in ActionBar along with icon?

enter image description here

Is that a text or just an image?

Eugene
  • 59,186
  • 91
  • 226
  • 333

1 Answers1

18

Use android:showAsAction="ifRoom|withText" to show the menu title along with the icon.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 1
    Hi This never works for me, i'm loading in Galaxy nexus and even using "always|withText" it only ever shows the text if in landscape mode. even though i am testing with just a single item and there is a entire title bar of unused space. Any ideas? – wired00 Dec 03 '12 at 05:53
  • 3
    seems it doesn't work in ICS+ http://stackoverflow.com/questions/12511348/title-for-icon-in-actionbar-is-not-shown – wired00 Dec 03 '12 at 06:00
  • 5
    @wired00: `showAsAction` is a hint, not a command. Android will interpret that hint how it wants based on screen size and orientation. – CommonsWare Dec 03 '12 at 11:34