本文整理汇总了C#中IMenu.RemoveItem方法的典型用法代码示例。如果您正苦于以下问题:C# IMenu.RemoveItem方法的具体用法?C# IMenu.RemoveItem怎么用?C# IMenu.RemoveItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMenu
的用法示例。
在下文中一共展示了IMenu.RemoveItem方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreateOptionsMenu
public override void OnCreateOptionsMenu (IMenu menu, MenuInflater inflater)
{
base.OnCreateOptionsMenu (menu, inflater);
menu.RemoveItem (Resource.Id.action_search);
menu.RemoveItem (Resource.Id.action_radar);
menu.RemoveItem (Resource.Id.action_settings);
}
示例2: OnPrepareOptionsMenu
public override bool OnPrepareOptionsMenu(IMenu menu)
{
if (indeterminateVisible) {
menu.RemoveItem (Resource.Id.action_edit);
menu.RemoveItem (Resource.Id.action_save);
}
return base.OnPrepareOptionsMenu (menu);
}
示例3: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
MenuInflater.Inflate (Resource.Menu.main_menu, menu);
int i = speechItemListView.CheckedItemPosition;
//if no text don't allow saving
if (string.IsNullOrWhiteSpace (textToSpeak.Text)) {
menu.RemoveItem (Resource.Id.menu_save);
}
//if nothing selected don't allow deleting
if (i < 0) {
menu.RemoveItem (Resource.Id.menu_delete);
}
return true;
}
示例4: OnPrepareActionMode
public bool OnPrepareActionMode(ActionMode mode, IMenu menu)
{
// Remove the "select all" option
menu.RemoveItem(Android.Resource.Id.SelectAll);
// Remove the "cut" option
menu.RemoveItem(Android.Resource.Id.Cut);
// Remove the "copy all" option
menu.RemoveItem(Android.Resource.Id.Copy);
return true;
}
示例5: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu (IMenu menu)
{
//change menu_search to your name
if (!refreshing) {
this.MenuInflater.Inflate (Resource.Menu.menu_home, menu);
if (viewModel.Places.Count == 0)
menu.RemoveItem (Resource.Id.action_navigation);
var searchItem = menu.FindItem (Resource.Id.action_search);
var provider = MenuItemCompat.GetActionView (searchItem);
searchView = provider.JavaCast<Android.Support.V7.Widget.SearchView> ();
searchView.QueryTextSubmit += (sender, args) => {
RefreshData (true, args.Query.Trim ());
var view = sender as Android.Support.V7.Widget.SearchView;
if (view != null)
view.ClearFocus ();
};
}
return base.OnCreateOptionsMenu (menu);
}
示例6: OnPrepareActionMode
public bool OnPrepareActionMode(ActionMode mode, IMenu menu)
{
menu.RemoveItem(global::Android.Resource.Id.SelectAll);
return true;
}