弹出菜单android

时间:2014-02-14 20:06:20

标签: android

我想制作一个来自操作栏的弹出菜单。因此,不是操作栏中的图标,而是会显示菜单,然后单击时会触发此弹出窗口。这可能吗?

 private void showPopupMenu(View v){
           popupMenu= new PopupMenu(menuActivity.this, v);
              popupMenu.getMenuInflater().inflate(R.menu.action_menu, popupMenu.getMenu());
              popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {      
           @Override
           public boolean onMenuItemClick(MenuItem item) {
            return true;
           }
          });
              popupMenu.show();
          }

1 个答案:

答案 0 :(得分:0)

尝试

QuickAction3D

并将菜单按钮指定为锚点