1

I would like to write under the text in the action bar so i use this xml:

 <item
    android:id="@+id/Home"
    android:icon="@drawable/ic_action_home"
    android:showAsAction="always|withText"
    android:title="home"/>
<item
    android:id="@+id/Refresh"
    android:icon="@drawable/ic_action_refresh"
    android:orderInCategory="100"
    android:showAsAction="always|withText"
    android:title="refresh"/>

although i write:

  android:showAsAction="always|withText"

this what i get :

enter image description here

How could I write text under the icons ?

user3376321
  • 849
  • 2
  • 9
  • 21

1 Answers1

0

'always|withText' only works if there is sufficient room. Else, it will only place icon. In your case, you've got several icons there which does not leave any spare room for text.

You've got two options:

  1. Reduce the icons by moving them either to an overflow menu or somewhere else in your UI.
  2. Design images which consist both icon and text and use them as your icons.

Edit: Well, here's a lot better answer: https://stackoverflow.com/a/12225863/2511884

Community
  • 1
  • 1
Saket
  • 2,945
  • 1
  • 29
  • 31
  • 1
    thank you for your response, actually i try to reduce the number of the icons, even i try to write on letter, but doesn't work. i think the second suggestion is the best. thank you – user3376321 Mar 20 '14 at 00:35