1
votes

I have only one menu item. Menu is placed at bottom of the page. Though I have used withText|always in xml file. I have even tried ifRoom|withText but title is not displaying in menu. Only icon is getting displayed. Long press on the menu item shows toast with the title of the item.

xml:

<menu xmlns:android="http://schemas.android.com/apk/res/android" 
  android:layout_width="match_parent"
   android:layout_height="match_parent" >

  <item
      android:id="@+id/fbmenu"
      android:icon="@drawable/fb"
      android:title="@string/likeus"
      android:orderInCategory="400"
      android:showAsAction="withText|always" />

</menu>

Java file:

  public boolean onCreateOptionsMenu(android.view.Menu menu) {

    super.onCreateOptionsMenu(menu);
    MenuInflater blowup = getMenuInflater();
    blowup.inflate(R.menu.fbmenu, menu);

    return true;

Here is the screenshot of app: http://i.stack.imgur.com/XD01c.png

1

1 Answers

0
votes

Make sure you target the support library namescape (app):

<menu
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item
        ...
        app:showAsAction="ifRoom|withText"
        android:showAsAction="ifRoom|withText"/>