0

I am new to Android. I am trying to use Actionbarsherlock in my application. I tried the following code in the onCreateOptionsMenu :

  menu.add("Save").setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
  menu.add("Edit").setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
  menu.add("Clear").setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
  menu.add("Refresh").setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
  menu.add("Save all").setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);

But i am not getting the overflow icon in the actionbar. I understood its a silly mistake. But i couldn't find where it is. Please help me to fix it!

4

1 回答 1

0

既然你要求MenuItem.SHOW_AS_ACTION_ALWAYS我认为没有菜单项进入溢出。

此外,如果设备有硬件菜单按钮,那么多余的图标不会溢出,而是您可以使用菜单按钮访问它们。

于 2013-04-05T07:58:43.607 回答