1

I'm currently trying to implement a popup menu that will appear after I clicked on an icon inside a fragment [The image is a part of the fragment in terms of layout]. I am able to make the popup menu show up. However, there is a problem that the menu shows on top of the Bottom Navigation instead of displaying below the icon.

https://i.stack.imgur.com/BoYKF.png

 mImageViewAddPerson = rootView.findViewById(R.id.message_img_addFriend);
    initRecycler(rootView);

    mImageViewAddPerson.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            PopupMenu popupMenu = new PopupMenu(getContext(), rootView);
            popupMenu.inflate(R.menu.add_person_menu);
            popupMenu.show();
        }
    })

Any suggestion on how to fix it?

Edit

I tried to implement the icon in the main Activity/Intent (This intent includes all the fragments) in order to show popup menu under the icon, but I don't know whether or not it's a right way to implement it.

Jason
  • 11
  • 2
  • Does this answer your question? [How change position of popup menu on android overflow button?](https://stackoverflow.com/questions/23516247/how-change-position-of-popup-menu-on-android-overflow-button) – Akhil Surapuram May 17 '20 at 21:55
  • Thanks for reply, I've tried the solution, but it doesn't seem to work the way I want. Thank you so much. – Jason May 17 '20 at 22:26

0 Answers0