Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add text to icons in ActionBar?

Tags:

android

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?

like image 536
Eugene Avatar asked Aug 25 '11 11:08

Eugene


People also ask

How to add icon in ActionBar in Android?

Add Action Buttons To add actions to the action bar, create a new XML file in your project's res/menu/ directory. The app:showAsAction attribute specifies whether the action should be shown as a button on the app bar.


1 Answers

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

like image 56
CommonsWare Avatar answered Oct 19 '22 03:10

CommonsWare