popupmenu

anchor popup menu over overflow button

拥有回忆 提交于 2019-11-28 12:25:19
I'm trying to create a custom popup menu that I would like to position on the overflow menu button of the actionbar (am using a Toolbar with setSupportActionBar() for this if it matters). I found out that this can be done with the setAnchorView() (from reading Custom Menu item in Overflow menu ). However I cant seem to figure out how to retrieve the overflow menu as a view (that I could use to set the anchor with). Also I did try anchoring this to the parent layout of the activity itself but it showed up on the left top, and the height of the menu was equal to the height of the actionbar

Implement pop up Menu with margin

China☆狼群 提交于 2019-11-28 10:54:17
I am using the default pop menu and expecting the behavior of the same. Everything is working fine. What my concern is regarding the rendering of pop up menu. My pop up menu sticks to the right of the screen. I want the behavior as used by Youtube app for android. I am mainly not able to provide right margin to my pop up menu. Please help. I have tried providing Gravity to PopUp Menu. But Pop Up Menu sticks to the Right of screen. PopupMenu popupMenu = new PopupMenu(mContext, anchor, Gravity.LEFT); popupMenu.getMenuInflater().inflate(R.menu.menu_edit_accessory, popupMenu.getMenu()); You can

How to set the background of Android PopupMenu to White [duplicate]

ⅰ亾dé卋堺 提交于 2019-11-28 09:27:14
This question already has an answer here: How to style PopupMenu? 5 answers I'm struggling with setting the background of PopupMenu. After googling it for a while, I found it should goes to the app theme. To be more specific, this should be defined in the style.xml. <style name="AppTheme" parent="AppBaseTheme"> <item name="android:popupMenuStyle">MY_STYLE</item> </style> However, I didn't really figure out which style exactly I should use, as I assume there's a built-in one. I tried with @android:style/Widget.Holo.PopupMenu and @android:style/Widget.Holo.Light.PopupMenu , but with no luck. For

Custom PopupMenu (layout)

匆匆过客 提交于 2019-11-28 09:24:17
I'm trying to upgrade my PopupMenu so it would come with icons and custom styles. I have created a new layout for it <?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android"> <RelativeLayout android:id="@+id/layout_sharea" android:background="@drawable/share" android:paddingLeft="10.0dip" android:paddingRight="10.0dip" android:layout_width="wrap_content" android:layout_height="50.0dip" android:onClick="share"> <TextView android:id="@+id/sharetexta" android:layout

The best way to create drop down menu in android 2.x like in ICS

删除回忆录丶 提交于 2019-11-28 07:37:31
I want to create button with drop down menu, like overflow menu button in ActionBar on ICS. I have problem because PopupMenu there isn't in android 2.x. The second way using Spinner but it's not for me, because Spinner always show the first item on my custom background or my selected item. How can I acheive it? In general, I want ContextMenu but little and on position clicked view. Thanks. It looks like this : If your purpose is to recreate an action bar, you could take a look at the ActionBarSherlock project, which backports thoses functionalities. If you want to be able to pop such a menu

Set Size of JComboBox PopupMenu

这一生的挚爱 提交于 2019-11-28 00:21:19
i am programming a custom component which extends a JComboBox. My problem is, the PopupMenu won't actualise its size if i am adding or removing an item. So there are e.g. 2 items in the list, but if there were 4 before i had 2 "empty" items in the PopupMenu as well. The only workaround i found was to do (in JIntelligentComboBox.java line 213) this.setPopupVisible(false); this.setPopupVisible(true); but the result will be a flickering PopupMenu :-( So what else could i do to refresh/repaint the PopupMenu without flickering? For testing: the component and a little test programm To generate my

anchor popup menu over overflow button

孤人 提交于 2019-11-27 19:23:37
问题 I'm trying to create a custom popup menu that I would like to position on the overflow menu button of the actionbar (am using a Toolbar with setSupportActionBar() for this if it matters). I found out that this can be done with the setAnchorView() (from reading Custom Menu item in Overflow menu). However I cant seem to figure out how to retrieve the overflow menu as a view (that I could use to set the anchor with). Also I did try anchoring this to the parent layout of the activity itself but

How to change the text color and size of a pop up menu in android?

旧街凉风 提交于 2019-11-27 18:01:57
问题 Text color in pop up menu is not changing even changed in styles. Background color is changing with respect to the color in styles.xml but the text color and text size are not reflecting. //Creating the instance of PopupMenu PopupMenu popup = new PopupMenu(mContext, holder.im_overflow); //Inflating the Popup using xml file popup.getMenuInflater().inflate(R.menu.list_overflow_menu, popup.getMenu()); //registering popup with OnMenuItemClickListener popup.setOnMenuItemClickListener(new PopupMenu

android popup menu text color (AppCompat)

蓝咒 提交于 2019-11-27 14:57:54
I need to change text color of a popuo menu but I don't find any way for do this, I can change background of popmenu but not the text, I edit the style.xml in this way: <style name="AppBaseTheme" parent="Theme.AppCompat.Light"> <!-- API 14 theme customizations can go here. --> <item name="popupMenuStyle">@style/MyPopupMenu</item> <item name="android:textAppearanceLargePopupMenu">@style/myPopupMenuTextAppearanceLarge</item> <item name="android:textAppearanceSmallPopupMenu">@style/myPopupMenuTextAppearanceSmall</item> </style> <style name="MyPopupMenu" parent="@style/Widget.AppCompat.PopupMenu">

How to create a custom PopupMenu in Android

我们两清 提交于 2019-11-27 12:28:35
问题 How can I replicate something like I made below in Balsamiq? I made this menu, but it is only displaying the text of the items (not the icons). Is it possible to display both the title and icon in a PopupMenu? Here is my create_post_menu.xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/action_photo" android:icon="@drawable/ic_action_camera" android:title="@string/action_photo" android:showAsAction="always