Skip to content Skip to sidebar Skip to footer

Popup Menu Comes Out In Left Bottom

I am trying to implement popup menu in my fragment but the result is far beyond my desire. I have a button on the action bar and one of these buttons call the popup menu and no pro

Solution 1:

You need to provide proper anchor view (overflow menu in this case) to the popup menu.

Try changing

showPopup(view);

to

ViewmenuItemView= MyActivity.this.findViewById(R.id.overflow_menu); // replace with your id
showPopup(menuItemView);

This should bring the popup menu to top. If its still on the left side use

popupMenu.setGravity(Gravity.END);

Post a Comment for "Popup Menu Comes Out In Left Bottom"