popupmenu

I Use ShareActionProvider in PopupMenu, but show two PopupMenu?

时光总嘲笑我的痴心妄想 提交于 2019-12-06 01:47:12
问题 I use a ShareActionProvider in a PopupMenu, but when I click the share menu item, it shows two PopupMenus on the screen, one covered by the other. And one shows the application icon and name, the other one only shows the application name. It works fine except this problem... How can I fix it? P.S.: please forgive me for my bad expression My code is: PopupMenu popup = new PopupMenu(this, button); popup.getMenuInflater().inflate(R.menu.scrawl_popup_menu, popup.getMenu()); MenuItem overflowItem

How to set a custom color for the popup of action items, including of the overflow menu?

浪子不回头ぞ 提交于 2019-12-06 01:03:03
Background I'm working on adding some material design style for an app, so I've chosen a different color for the action bar and status bar. The problem For this, the theme of the app is of "Theme.AppCompat.Light.DarkActionBar", and added this to hide the action bar as I need to handle it as a toolbar: theme I've used: <style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> <item name="windowActionModeOverlay">true</item> </style> layout I've used : <LinearLayout xmlns:android="http://schemas

How to get the position of an Item from a PopupMenu in a custom ListView

爱⌒轻易说出口 提交于 2019-12-05 23:56:16
问题 Here's the problem: I've got a custom ArrayAdapter (overriden getView). Each item has got 2 ImageView 2 EditText One of those ImageView is clickable and enables a PopupMenu, so I've got a little PopupMenu for each item of the list. Now, for that menu I need some parameters from the item to wich is anchored. So, how to pass informations (like position) to the method called from the PopupMenu voice? Attached the xml files. item_list.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns

How to attach context menu to TChromium browser

爱⌒轻易说出口 提交于 2019-12-05 10:44:04
I have a TChromium broser from Delphi Chromium Embedded (http://code.google.com/p/delphichromiumembedded). I would like to attach a context menu to it. How I can achieve that? You need to handle the OnBeforeMenu event. In that event handler is enough to set the output parameter Result to True what will suppress the default context menus to popup. After that you can display your own menu on the positions obtained from the menuInfo structure. Here's the code sample with a custom popup menu: uses ceflib, cefvcl; procedure TForm1.FormCreate(Sender: TObject); begin Chromium1.Load('www.example.com')

How can I edit the dimensions of a PopUp Menu Item in Android?

僤鯓⒐⒋嵵緔 提交于 2019-12-05 09:59:17
I have a PopUp Menu that drops down when I click a button. However I feel the items in this menu don't look good with respect to the overall view of my App. I was wondering if I could edit the dimensions of the items in the Menu. Maybe make the height of each item shorter, if possible. PopupMenu popup = new PopupMenu(this, settingsButton); MenuInflater inflater = popup.getMenuInflater(); inflater.inflate(R.menu.settings_menu, popup.getMenu()); Then in the onClick() method of the button I call show() popup.show(); 来源: https://stackoverflow.com/questions/12257769/how-can-i-edit-the-dimensions-of

How to create a button with drop-down menu?

霸气de小男生 提交于 2019-12-05 06:02:44
Is there a way to show IE/Firefox Back button style, dropdown menu button? I am assuming you mean a button that drops down a menu when clicked. You can also just manually code your button click to drop down a TPopupMenu under it. Example : Drop anything with a TClickEvent (maybe a TButton) and a TPopupMenu on your form. Add some menu items. Then add the following OnClick event handler: procedure TForm86.Button1Click(Sender: TObject); var button: TControl; lowerLeft: TPoint; begin if Sender is TControl then begin button := TControl(Sender); lowerLeft := Point(button.Left, button.Top + Button

Android Custom Popup menu with switch

允我心安 提交于 2019-12-05 05:34:14
How can I customize the menuItems in a popup menu? I need a switch for the first menuitem. Here is what I got so far: menu.xml <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context="android.oli.com.fitnessapp.activities.LiveSelectActivity"> <item android:icon="@drawable/ic_access_alarm_white_24dp" android:orderInCategory="100" app:showAsAction="always" android:visible="true" android:title="@string/action_settings" android:onClick="showPopup"/> </menu> menu_popup.xml <?xml

How to change PopupMenu items font

半城伤御伤魂 提交于 2019-12-05 01:14:39
I want to change the default font of PopupMenu items and use from my custom font for them. This is the code that I used for creating PopupMenu : PopupMenu pm = new PopupMenu(this, v); getMenuInflater().inflate(R.menu.main, pm.getMenu()); pm.show(); And the menu Items : <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/Setting" android:title="Setting"/> <item android:id="@+id/About" android:title="About"/> <item android:id="@+id/Help" android:title="Help"/> </menu> I will be so thankful if you share your suggestions with me :-) Regards Gaurav Gupta Check

Set Popup menu to full screen

折月煮酒 提交于 2019-12-05 01:11:23
Note : This is popup menu not popup window.So I request you all to read carefully. I have implemented pop menu. It is displaying in half of the screen. I want to spread this to entire width of device. I tried to change its style by setting layout_width as match_parent but with no success. Below is what I tried so far: Style <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="popupMenuStyle">@style/PopupMenu</item> </style> <!-- Change Overflow Menu Background --> <style name="PopupMenu" parent=

How to force PopupMenu to overlap anchor?

南笙酒味 提交于 2019-12-04 20:39:33
问题 How to force PopupMenu to overlap anchor? I would like to recreate something similar to this: 回答1: Setting overlapAnchor allowed me to overlap anchor view without setting offset: <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="popupMenuStyle">@style/PopupMenu</item> </style> <style name="PopupMenu" parent="@style/Widget.AppCompat.Light.PopupMenu"> <item name="overlapAnchor">true</item> </style> The PopupMenu wraps a ListPopupWindow inside it. This