本文整理汇总了C#中IMenu.Add方法的典型用法代码示例。如果您正苦于以下问题:C# IMenu.Add方法的具体用法?C# IMenu.Add怎么用?C# IMenu.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMenu
的用法示例。
在下文中一共展示了IMenu.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
MenuInflater.Inflate (Resource.Menu.Main, menu);
/*var searchMenu = menu.Add ("Search");
searchMenu.SetVisible (true);
searchMenu.SetShowAsAction (ShowAsAction.IfRoom);
searchMenu.SetActionView(new SearchView(this));*/
var addMenu = menu.Add (1, (int)MenuConstants.MainAdd, 1, "Add");
addMenu.SetIcon (Resource.Drawable.Add);
addMenu.SetShowAsAction (ShowAsAction.IfRoom);
var refreshMenu = menu.Add (1, (int)MenuConstants.MainRefresh, 2, "Refresh");
refreshMenu.SetIcon (Resource.Drawable.Refresh);
refreshMenu.SetShowAsAction (ShowAsAction.IfRoom);
/*var facebookMenu = menu.Add (2, (int)MenuConstants.MainFacebook, 3, "Authorize Facebook");
facebookMenu.SetIcon (Resource.Drawable.Facebook);
facebookMenu.SetShowAsAction (ShowAsAction.IfRoom);
var twitterMenu = menu.Add (2, (int)MenuConstants.MainTwitter, 4, "Authorize Twitter");
twitterMenu.SetIcon (Resource.Drawable.Twitter);
twitterMenu.SetShowAsAction (ShowAsAction.IfRoom);*/
return base.OnCreateOptionsMenu (menu);
}
示例2: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
menu.Add("Item 1");
menu.Add("Item 2");
menu.Add("Item 3");
return true;
}
示例3: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
base.OnCreateOptionsMenu(menu);
menu.Add(0, EDIT_ID, 0, Resource.String.menu_edit)
.SetShortcut('1', 'e')
.SetIcon(Resource.Drawable.icon_delete);
//menu.add(0, HOME_ID, 0, R.string.menu_start).setShortcut('4', 'h')
// .setIcon(R.drawable.icon_start);
menu.Add(0, LIST_ID, 0, Resource.String.menu_recent)
.SetShortcut('3', 'r')
.SetIcon(Resource.Drawable.icon_recent);
menu.Add(0, DELETE_ID, 0, Resource.String.menu_delete)
.SetShortcut('2', 'd')
.SetIcon(Resource.Drawable.icon_delete);
//menu.add(0, ABOUT_ID, 0, R.string.menu_about).setShortcut('5', 'a')
// .setIcon(android.R.drawable.ic_dialog_info);
//menu.add(0, EXPORT_ID, 0, R.string.menu_export).setShortcut('7', 'x')
// .setIcon(android.R.drawable.ic_dialog_info);
//menu.add(0, IMPORT_ID, 0, R.string.menu_import).setShortcut('8', 'm')
// .setIcon(android.R.drawable.ic_dialog_info);
//menu.add(0, EMAIL_ID, 0, R.string.menu_email).setShortcut('6', 'm')
// .setIcon(android.R.drawable.ic_dialog_info);
return true;
}
示例4: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
var MenuItem1 = menu.Add(0, 1, 1, "Aktualisieren");
var MenuItem2 = menu.Add(0, 2, 2, "Beenden");
// Set icon
return base.OnCreateOptionsMenu(menu);
}
示例5: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
menu.Add(Menu.None, 0, Menu.None, "Settings").SetIcon(Android.Resource.Drawable.IcMenuManage);
menu.Add(Menu.None, 1, Menu.None, "Theme").SetIcon(Android.Resource.Drawable.IcMenuGallery);
//menu.Add(Menu.None, 2, Menu.None, "Share").SetIcon(Android.Resource.Drawable.IcMenuShare);
return true;// base.OnCreateOptionsMenu(menu);
}
示例6: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
var b = base.OnCreateOptionsMenu(menu);
menu.Add(1, 0, 1, Resource.String.viewcard_Left);
menu.Add(1, 1, 1, Resource.String.viewcard_Edit);
menu.Add(1, 2, 1, Resource.String.viewcard_Right);
return b;
}
示例7: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
menu.Add (0, 0, 0, "Выбрать журнал");
menu.Add(0,1,1,"О программе");
menu.Add(0,2,2,"Выход");
return true;
}
示例8: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
var menuItem1 = menu.Add(0, 1, 1, Resource.String.Copyright);
var menuItem2 = menu.Add(0, 2, 2, Resource.String.Close);
menuItem1.SetIcon(Resource.Drawable.exclaim);
menuItem2.SetIcon(Resource.Drawable.close);
return base.OnCreateOptionsMenu(menu);
}
示例9: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
var refreshMenuItem = menu.Add(0, 1, 1, Resource.String.Refresh);
var quitMenuItem = menu.Add(0, 1, 1, Resource.String.Quit);
refreshMenuItem.SetIcon(Resource.Drawable.refresh);
quitMenuItem.SetIcon(Resource.Drawable.logout);
return true;
}
示例10: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
menu.Add (0, 0, 0, "切换帐号");
menu.Add (1, 1, 1, "前一天");
menu.Add (1, 2, 2, "后一天");
menu.Add (2, 3, 3, "添加课程");
return true;
}
示例11: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu (IMenu menu)
{
menu.Add (Menu.None, 0, Menu.None, Resource.String.simpleSaveState);
menu.Add (Menu.None, 1, Menu.None, Resource.String.nonConfigInstance);
menu.Add (Menu.None, 2, Menu.None, Resource.String.layoutInCode);
return base.OnCreateOptionsMenu (menu);
}
示例12: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
var res = base.OnCreateOptionsMenu(menu);
menu.Add(0, MenuItem_AddCard, 0, Resource.String.AddCard);
menu.Add(0, MenuItem_Exit, 1, Resource.String.Exit);
return res;
}
示例13: OnCreateOptionsMenu
public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
{
// Put overlay items first
MapView.OverlayManager.OnCreateOptionsMenu(menu, MenuLastId, MapView);
menu.Add(0, MenuZoominId, Menu.None, "ZoomIn");
menu.Add(0, MenuZoomoutId, Menu.None, "ZoomOut");
base.OnCreateOptionsMenu(menu, inflater);
}
示例14: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
var configItem = menu.Add(0, 1, 1, "Config".ToJ());
configItem.SetIcon(Resource.Drawable.ic_menu_preferences);
var aboutItem = menu.Add(0, 1, 1, "About".ToJ());
aboutItem.SetIcon(Resource.Drawable.ic_menu_info_details); // IcMenuInfoDetails);
var exitItem = menu.Add(0, 1, 1, "Exit".ToJ());
exitItem.SetIcon(Resource.Drawable.ic_menu_close_clear_cancel);
return true;
}
示例15: OnCreateOptionsMenu
/// <summary>
/// http://mgroves.com/monodroid-creating-an-options-menu/
/// </summary>
public override bool OnCreateOptionsMenu(IMenu menu)
{
var item = menu.Add(Menu.None, 1, 1, new Java.Lang.String("Schedule"));
//item.SetIcon(Resource.Drawable.calendar);
item = menu.Add(Menu.None, 2, 2, new Java.Lang.String("Speakers")); // HACK: todo - add 'using' statement around Java.Lang.Strings for GC (as per novell hint)
//item.SetIcon(Resource.Drawable.microphone);
item = menu.Add(Menu.None, 3, 3, new Java.Lang.String("Sessions"));
//item.SetIcon(Resource.Drawable.bullhorn);
item = menu.Add(Menu.None, 4, 4, new Java.Lang.String("Map"));
//item.SetIcon(Resource.Drawable.map);
item = menu.Add(Menu.None, 5, 5, new Java.Lang.String("Favorites"));
//item.SetIcon(Resource.Drawable.star);
item = menu.Add(Menu.None, 6, 6, new Java.Lang.String("News"));
//item.SetIcon(Resource.Drawable.star);
item = menu.Add(Menu.None, 7, 7, new Java.Lang.String("Twitter"));
//item.SetIcon(Resource.Drawable.star);
item = menu.Add(Menu.None, 8, 8, new Java.Lang.String("Exhibitors"));
//item.SetIcon(Resource.Drawable.star);
item = menu.Add(Menu.None, 9, 9, new Java.Lang.String("About Xamarin"));
//item.SetIcon(Resource.Drawable.star);
return true;
}