5

The menuItem is used in ActionToolbar and popupMenu. The text in the menuItem is long and would like to wrap it into two lines. I Tried use "\n" and seems it is replaced with space. Searched and not able to find a solution.

Tried the following, not work:

<string name=“long_name_menuitem”>This is a\nlong name item</string>

PopupMenu popup = new PopupMenu(getActivity(), v);

popup.getMenu().add(Menu.NONE, id, Menu.NONE,     
    getResources().getString(R.string.long_name_menuitem));

or or define the menuItem

<item
    android:id="@+id/menu_lone_name”        
    android:title="@string/long_name_menuitem"/>

Anyone has idea how to do it? Thanks!

lannyf
  • 9,865
  • 12
  • 70
  • 152

0 Answers0