Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ActionBar item with Text Only

Tags:

android

I want to place an item in the actionbar that has only text. I am using ActionBarSherlock. How can i do this. One is define an icon with a text. I would not prefer to do that . Is it possible to have a text item from my string resources ?

like image 841
AndroidDev Avatar asked Oct 05 '12 05:10

AndroidDev


2 Answers

Just don't define the

android:icon

field in the menu.xml for that item.

like image 106
dorjeduck Avatar answered Nov 01 '22 08:11

dorjeduck


Just figured this out, make sure to add android:showAsAction="always"

<item 
    android:id="@+id/menu_item"
    android:showAsAction="always"
    android:title="@string/menu_title" />
like image 30
kevbot Avatar answered Nov 01 '22 08:11

kevbot