次の方法で共有


IMenu.AddSubMenu Method

Definition

Overloads

AddSubMenu(ICharSequence)

Add a new sub-menu to the menu.

AddSubMenu(Int32)

Add a new sub-menu to the menu.

AddSubMenu(Int32, Int32, Int32, ICharSequence)

Add a new sub-menu to the menu.

AddSubMenu(Int32, Int32, Int32, Int32)

Variation on #addSubMenu(int, int, int, CharSequence) that takes a string resource identifier for the title instead of the string itself.

AddSubMenu(ICharSequence)

Add a new sub-menu to the menu.

[Android.Runtime.Register("addSubMenu", "(Ljava/lang/CharSequence;)Landroid/view/SubMenu;", "GetAddSubMenu_Ljava_lang_CharSequence_Handler:Android.Views.IMenuInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Android.Views.ISubMenu? AddSubMenu (Java.Lang.ICharSequence? title);
[<Android.Runtime.Register("addSubMenu", "(Ljava/lang/CharSequence;)Landroid/view/SubMenu;", "GetAddSubMenu_Ljava_lang_CharSequence_Handler:Android.Views.IMenuInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member AddSubMenu : Java.Lang.ICharSequence -> Android.Views.ISubMenu

Parameters

title
ICharSequence

The text to display for the item.

Returns

The newly added sub-menu

Attributes

Remarks

Add a new sub-menu to the menu. This item displays the given title for its label. To modify other attributes on the submenu's menu item, use SubMenu#getItem().

Java documentation for android.view.Menu.addSubMenu(java.lang.CharSequence).

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

AddSubMenu(Int32)

Add a new sub-menu to the menu.

[Android.Runtime.Register("addSubMenu", "(I)Landroid/view/SubMenu;", "GetAddSubMenu_IHandler:Android.Views.IMenuInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Android.Views.ISubMenu? AddSubMenu (int titleRes);
[<Android.Runtime.Register("addSubMenu", "(I)Landroid/view/SubMenu;", "GetAddSubMenu_IHandler:Android.Views.IMenuInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member AddSubMenu : int -> Android.Views.ISubMenu

Parameters

titleRes
Int32

Resource identifier of title string.

Returns

The newly added sub-menu

Attributes

Remarks

Add a new sub-menu to the menu. This item displays the given title for its label. To modify other attributes on the submenu's menu item, use SubMenu#getItem().

Java documentation for android.view.Menu.addSubMenu(int).

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

AddSubMenu(Int32, Int32, Int32, ICharSequence)

Add a new sub-menu to the menu.

[Android.Runtime.Register("addSubMenu", "(IIILjava/lang/CharSequence;)Landroid/view/SubMenu;", "GetAddSubMenu_IIILjava_lang_CharSequence_Handler:Android.Views.IMenuInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Android.Views.ISubMenu? AddSubMenu (int groupId, int itemId, int order, Java.Lang.ICharSequence? title);
[<Android.Runtime.Register("addSubMenu", "(IIILjava/lang/CharSequence;)Landroid/view/SubMenu;", "GetAddSubMenu_IIILjava_lang_CharSequence_Handler:Android.Views.IMenuInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member AddSubMenu : int * int * int * Java.Lang.ICharSequence -> Android.Views.ISubMenu

Parameters

groupId
Int32

The group identifier that this item should be part of. This can also be used to define groups of items for batch state changes. Normally use #NONE if an item should not be in a group.

itemId
Int32

Unique item ID. Use #NONE if you do not need a unique ID.

order
Int32

The order for the item. Use #NONE if you do not care about the order. See MenuItem#getOrder().

title
ICharSequence

The text to display for the item.

Returns

The newly added sub-menu

Attributes

Remarks

Add a new sub-menu to the menu. This item displays the given <var>title</var> for its label. To modify other attributes on the submenu's menu item, use SubMenu#getItem().

Note that you can only have one level of sub-menus, i.e. you cannnot add a subMenu to a subMenu: An UnsupportedOperationException will be thrown if you try.

Java documentation for android.view.Menu.addSubMenu(int, int, int, java.lang.CharSequence).

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

AddSubMenu(Int32, Int32, Int32, Int32)

Variation on #addSubMenu(int, int, int, CharSequence) that takes a string resource identifier for the title instead of the string itself.

[Android.Runtime.Register("addSubMenu", "(IIII)Landroid/view/SubMenu;", "GetAddSubMenu_IIIIHandler:Android.Views.IMenuInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Android.Views.ISubMenu? AddSubMenu (int groupId, int itemId, int order, int titleRes);
[<Android.Runtime.Register("addSubMenu", "(IIII)Landroid/view/SubMenu;", "GetAddSubMenu_IIIIHandler:Android.Views.IMenuInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member AddSubMenu : int * int * int * int -> Android.Views.ISubMenu

Parameters

groupId
Int32

The group identifier that this item should be part of. This can also be used to define groups of items for batch state changes. Normally use #NONE if an item should not be in a group.

itemId
Int32

Unique item ID. Use #NONE if you do not need a unique ID.

order
Int32

The order for the item. Use #NONE if you do not care about the order. See MenuItem#getOrder().

titleRes
Int32

Resource identifier of title string.

Returns

The newly added sub-menu

Attributes

Remarks

Variation on #addSubMenu(int, int, int, CharSequence) that takes a string resource identifier for the title instead of the string itself.

Java documentation for android.view.Menu.addSubMenu(int, int, int, int).

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