Compartilhar via


IMenuItem.SetChecked(Boolean) Method

Definition

Control whether this item is shown with a check mark.

[Android.Runtime.Register("setChecked", "(Z)Landroid/view/MenuItem;", "GetSetChecked_ZHandler:Android.Views.IMenuItemInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Android.Views.IMenuItem SetChecked (bool checked);
[<Android.Runtime.Register("setChecked", "(Z)Landroid/view/MenuItem;", "GetSetChecked_ZHandler:Android.Views.IMenuItemInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member SetChecked : bool -> Android.Views.IMenuItem

Parameters

checked
Boolean

Set to true to display a check mark, false to hide it. The default value is false.

Returns

This Item so additional setters can be called.

Attributes

Remarks

Control whether this item is shown with a check mark. Note that you must first have enabled checking with #setCheckable or else the check mark will not appear. If this item is a member of a group that contains mutually-exclusive items (set via Menu#setGroupCheckable(int, boolean, boolean), the other items in the group will be unchecked.

See Menu for the menu types that support check marks.

Java documentation for android.view.MenuItem.setChecked(boolean).

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

See also