PopupMenu Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
PopupMenu(Context, View) |
Constructor to create a new popup menu with an anchor view. |
PopupMenu(IntPtr, JniHandleOwnership) |
A constructor used when creating managed representations of JNI objects; called by the runtime. |
PopupMenu(Context, View, GravityFlags) |
Constructor to create a new popup menu with an anchor view and alignment gravity. |
PopupMenu(Context, View, GravityFlags, Int32, Int32) |
Constructor a create a new popup menu with a specific style. |
PopupMenu(Context, View)
Constructor to create a new popup menu with an anchor view.
[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/view/View;)V", "")]
public PopupMenu (Android.Content.Context? context, Android.Views.View? anchor);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/view/View;)V", "")>]
new Android.Widget.PopupMenu : Android.Content.Context * Android.Views.View -> Android.Widget.PopupMenu
Parameters
- context
- Context
Context the popup menu is running in, through which it can access the current theme, resources, etc.
- anchor
- View
Anchor view for this popup. The popup will appear below the anchor if there is room, or above it if there is not.
- Attributes
Remarks
Constructor to create a new popup menu with an anchor view.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
PopupMenu(IntPtr, JniHandleOwnership)
A constructor used when creating managed representations of JNI objects; called by the runtime.
protected PopupMenu (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.Widget.PopupMenu : nativeint * Android.Runtime.JniHandleOwnership -> Android.Widget.PopupMenu
Parameters
- transfer
- JniHandleOwnership
A JniHandleOwnershipindicating how to handle javaReference
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
PopupMenu(Context, View, GravityFlags)
Constructor to create a new popup menu with an anchor view and alignment gravity.
[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/view/View;I)V", "")]
public PopupMenu (Android.Content.Context? context, Android.Views.View? anchor, Android.Views.GravityFlags gravity);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/view/View;I)V", "")>]
new Android.Widget.PopupMenu : Android.Content.Context * Android.Views.View * Android.Views.GravityFlags -> Android.Widget.PopupMenu
Parameters
- context
- Context
Context the popup menu is running in, through which it can access the current theme, resources, etc.
- anchor
- View
Anchor view for this popup. The popup will appear below the anchor if there is room, or above it if there is not.
- gravity
- GravityFlags
The Gravity
value for aligning the popup with its
anchor.
- Attributes
Remarks
Constructor to create a new popup menu with an anchor view and alignment gravity.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
PopupMenu(Context, View, GravityFlags, Int32, Int32)
Constructor a create a new popup menu with a specific style.
[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/view/View;III)V", "", ApiSince=22)]
public PopupMenu (Android.Content.Context? context, Android.Views.View? anchor, Android.Views.GravityFlags gravity, int popupStyleAttr, int popupStyleRes);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/view/View;III)V", "", ApiSince=22)>]
new Android.Widget.PopupMenu : Android.Content.Context * Android.Views.View * Android.Views.GravityFlags * int * int -> Android.Widget.PopupMenu
Parameters
- context
- Context
Context the popup menu is running in, through which it can access the current theme, resources, etc.
- anchor
- View
Anchor view for this popup. The popup will appear below the anchor if there is room, or above it if there is not.
- gravity
- GravityFlags
The Gravity
value for aligning the popup with its
anchor.
- popupStyleAttr
- Int32
An attribute in the current theme that contains a reference to a style resource that supplies default values for the popup window. Can be 0 to not look for defaults.
- popupStyleRes
- Int32
A resource identifier of a style resource that supplies default values for the popup window, used only if popupStyleAttr is 0 or can not be found in the theme. Can be 0 to not look for defaults.
- Attributes
Remarks
Constructor a create a new popup menu with a specific style.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.