Android Guides | Samples

Android.Widget.PopupMenu Class

A PopupMenu displays a Menu in a modal popup window anchored to a View.

See Also: PopupMenu

Syntax

[Android.Runtime.Register("android/widget/PopupMenu", DoNotGenerateAcw=true)]
public class PopupMenu : Object

Remarks

A PopupMenu displays a Menu in a modal popup window anchored to a View. The popup will appear below the anchor view if there is room, or above it if there is not. If the IME is visible the popup will not overlap it until it is touched. Touching outside of the popup will dismiss it.

[Android Documentation]

Requirements

Namespace: Android.Widget
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 11

The members of Android.Widget.PopupMenu are listed below.

See Also: Object

Public Constructors

Constructor to create a new popup menu with an anchor view.
Constructor to create a new popup menu with an anchor view and alignment gravity.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
DragToOpenListenerView+IOnTouchListener. Returns an NoType:android/view/View$OnTouchListener;Href=../../../reference/android/view/View.OnTouchListener.html that can be added to the anchor view to implement drag-to-open behavior.
[read-only]
MenuIMenu.
[read-only]
MenuInflaterMenuInflater.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

Dismiss()
Dismiss the menu popup.
Inflate(Int32)
Inflate a menu resource into this PopupMenu.
SetOnDismissListener(PopupMenu+IOnDismissListener)
Set a listener that will be notified when this menu is dismissed.
SetOnMenuItemClickListener(PopupMenu+IOnMenuItemClickListener)
Set a listener that will be notified when the user selects an item from the menu.
Show()
Show the menu popup anchored to the view specified during construction.

Public Events