Beispiel #1
0
 /// <summary>
 /// Creates the menu and inflates it
 /// </summary>
 /// <param name="menu">the menu created</param>
 /// <returns></returns>
 public override bool OnCreateOptionsMenu(Android.Views.IMenu menu)
 {
     MenuInflater.Inflate(Resource.Menu.menu, menu);
     for (int i = 0; i < menu.Size(); i++)
     {
         Android.Views.IMenuItem item = menu.GetItem(i);
         item.SetShowAsAction(Android.Views.ShowAsAction.Always);
     }
     return(base.OnCreateOptionsMenu(menu));
 }
        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            int group = 0;

            IMenuItem item1 = menu.Add(group, SWAP_MENU, SWAP_MENU, "Swap Language");

            item1.SetIcon(Resource.Drawable.swap);
            item1.SetShowAsAction(ShowAsAction.Never | ShowAsAction.WithText);

            IMenuItem item2 = menu.Add(group, PINYIN_MENU, PINYIN_MENU, "Pinyin Toggle");

            item2.SetIcon(Resource.Drawable.pinyin);
            item2.SetShowAsAction(ShowAsAction.IfRoom);

            //IMenuItem item3 = menu.Add(group, SYNC_MENU, SYNC_MENU, "Sync");
            //item3.SetShowAsAction(ShowAsAction.Never | ShowAsAction.WithText);

            IMenuItem item4 = menu.Add(group, SETTINGS_MENU, SETTINGS_MENU, "Settings");

            item4.SetShowAsAction(ShowAsAction.Never | ShowAsAction.WithText);

            return(base.OnCreateOptionsMenu(menu));
        }