Most visited

Recently visited

Added in API level 1

SubMenu

public interface SubMenu
implements Menu

android.view.SubMenu


子菜单的子类 Menu

子菜单不支持项目图标或嵌套的子菜单。

Developer Guides

有关创建菜单的信息,请阅读 Menus开发人员指南。

Summary

Inherited constants

From interface android.view.Menu

Public methods

abstract void clearHeader()

清除子菜单的标题。

abstract MenuItem getItem()

获取代表父菜单中此子菜单的 MenuItem

abstract SubMenu setHeaderIcon(int iconRes)

将子菜单标题的图标设置为 iconRes资源标识中给出的图标。

abstract SubMenu setHeaderIcon(Drawable icon)

将子菜单标题的图标设置为 图标 Drawable给出的 图标

abstract SubMenu setHeaderTitle(int titleRes)

将submenu标题的标题设置为 titleRes资源标识中给出的标题。

abstract SubMenu setHeaderTitle(CharSequence title)

将子菜单标题的标题设置为标题中给出的 标题

abstract SubMenu setHeaderView(View view)

设置子菜单到的报头 View 鉴于给出。

abstract SubMenu setIcon(Drawable icon)

在其父菜单中更改与此子菜单项目相关联的图标。

abstract SubMenu setIcon(int iconRes)

在其父菜单中更改与此子菜单项目相关联的图标。

Inherited methods

From interface android.view.Menu

Public methods

clearHeader

Added in API level 1
void clearHeader ()

清除子菜单的标题。

getItem

Added in API level 1
MenuItem getItem ()

获取在父菜单中表示此子菜单的MenuItem 用它来设置其他项目属性。

Returns
MenuItem The MenuItem that launches the submenu when invoked.

setHeaderIcon

Added in API level 1
SubMenu setHeaderIcon (int iconRes)

将子菜单标题的图标设置为 iconRes资源标识中给出的图标。

Parameters
iconRes int: The resource identifier used for the icon.
Returns
SubMenu This SubMenu so additional setters can be called.

setHeaderIcon

Added in API level 1
SubMenu setHeaderIcon (Drawable icon)

将子菜单标题的图标设置为 图标 Drawable给出的 图标

Parameters
icon Drawable: The Drawable used for the icon.
Returns
SubMenu This SubMenu so additional setters can be called.

setHeaderTitle

Added in API level 1
SubMenu setHeaderTitle (int titleRes)

将submenu标题的标题设置为 titleRes资源标识中给出的标题。

Parameters
titleRes int: The string resource identifier used for the title.
Returns
SubMenu This SubMenu so additional setters can be called.

setHeaderTitle

Added in API level 1
SubMenu setHeaderTitle (CharSequence title)

将子菜单标题的标题设置为标题中给出的 标题

Parameters
title CharSequence: The character sequence used for the title.
Returns
SubMenu This SubMenu so additional setters can be called.

setHeaderView

Added in API level 1
SubMenu setHeaderView (View view)

设置子菜单到的报头View 鉴于给出。 这取代了标题标题和图标(以及那些替换它)。

Parameters
view View: The View used for the header.
Returns
SubMenu This SubMenu so additional setters can be called.

setIcon

Added in API level 1
SubMenu setIcon (Drawable icon)

在其父菜单中更改与此子菜单项目相关联的图标。

Parameters
icon Drawable: The new icon (as a Drawable) to be displayed.
Returns
SubMenu This SubMenu so additional setters can be called.

也可以看看:

setIcon

Added in API level 1
SubMenu setIcon (int iconRes)

在其父菜单中更改与此子菜单项目相关联的图标。

Parameters
iconRes int: The new icon (as a resource ID) to be displayed.
Returns
SubMenu This SubMenu so additional setters can be called.

也可以看看:

Hooray!