Not able to position the popup menu below the view anchor
See original GitHub issueI am not able to position the popup menu below the view anchor like in this picture:
I have tried to set dropdownGravity = Gravity.BOTTOM
without success. I have also tested with other Gravity constants (i.e END, START, TOP, etc.) but wasn’t able to achieve the desired result.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How change position of popup menu on android overflow ...
Just put an invisible view to where you want the popup menu to anchor: <View android:id="@+id/anchor_menu" android:layout_width="0dp" ...
Read more >Menus and Popups | CodePath Android Cliffnotes
PopupMenu - A modal menu that is anchored to a particular view within an activity. The menu appears below that view when it...
Read more >PopupMenu - Android Developers
The popup will appear below the anchor view if there is room, or above it if there is not. If the IME is...
Read more >How To Trigger A Popup From A Nav Menu Item - Elementor
In the Advanced tab of the Popup Settings, we will add a small code snippet into the Open By Selector field. For this...
Read more >Change Desktop & Dock settings on Mac - Apple Support (AZ)
Locate the Dock along the left, bottom, or right edge of the screen. ... On Desktop Only: Hide and show the menu bar...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have something ready which you might try here (See “Custom offsets” sample): https://github.com/zawadz88/MaterialPopupMenu/tree/feature/custom-offsets
Using
dropdownGravity
seems like a more generic approach though, but it’ll require further investigation as depending on the amount of space available (top/bottom of the screen) the results might differ.Hi @zawadz88,
Thanks for your time. I also think that it is vital to be able to position the Menu. In my case, I am animating the icon when popup menu is opened and closed. Therefore, this feature was very important to me. Also, I noticed that there is no OnCloseListener. I think that it will be a good enhancement either.
Because of these 2 issues, I decided to create my own custom PopupWindow. Nevertheless, thanks for this great library.