当前位置: 首页>>代码示例>>C#>>正文


C# IMenuItem.SetIcon方法代码示例

本文整理汇总了C#中IMenuItem.SetIcon方法的典型用法代码示例。如果您正苦于以下问题:C# IMenuItem.SetIcon方法的具体用法?C# IMenuItem.SetIcon怎么用?C# IMenuItem.SetIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMenuItem的用法示例。


在下文中一共展示了IMenuItem.SetIcon方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnOptionsItemSelected

		public override bool OnOptionsItemSelected (IMenuItem item) {
			switch (item.ItemId) {
			case Android.Resource.Id.Home:
				StartActivity(new Intent(this.Activity, typeof(OrderActivity)));



				break;
			case Resource.Id.fav: 
				if (favChecked) {
					item.SetIcon (Resources.GetDrawable (Resource.Drawable.fav));
					favChecked = false;
				} else {
					item.SetIcon (Resources.GetDrawable (Resource.Drawable.favchecked));
					favChecked = true;
				}
				break;
			}

			base.OnOptionsItemSelected (item);
			return true;
		}
开发者ID:damian-grasso,项目名称:taptap,代码行数:22,代码来源:CoffeeFragment.cs

示例2: OnCreateOptionsMenu

		public override bool OnCreateOptionsMenu(IMenu menu){
			//bool isRunning = IsTunnelServiceRunning();
			base.OnCreateOptionsMenu (menu);
			MenuInflater.Inflate(Resource.Layout.OptionMenu,menu);
			startButton = menu.FindItem(Resource.Id.option_start_stop);
			connectButton = menu.FindItem(Resource.Id.option_connect);;
			exitButton = menu.FindItem(Resource.Id.option_exit);

			connectButton.SetTitle("Connect To Client");
			connectButton.SetIcon(Resource.Drawable.addClient);

			exitButton.SetIcon(Resource.Drawable.exit);
			exitButton.SetTitle("Exit");
			return true;
		}
开发者ID:seipekm,项目名称:MonoBrick-Communication-Software,代码行数:15,代码来源:OptionMenu.cs

示例3: OnCreateOptionsMenu

        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            //			inflater.Inflate (Resource.Menu.mfActionBar, menu);

            miAddAtt = menu.Add (1, 1, 1, @"Начать посещение");
            miAddAtt.SetIcon (Resource.Drawable.ic_add_circle_outline_white_48dp);
            //			miAddAtt.SetShowAsAction()
            miAddAtt.SetEnabled (true);

            //			miAddAtt.Id

            miAddPhoto = menu.Add(1, 2, 2, @"Добавить фото");
            miAddPhoto.SetIcon (Resource.Drawable.ic_camera_alt_white_48dp);
            miAddPhoto.SetEnabled (false);

            base.OnCreateOptionsMenu (menu, inflater);
        }
开发者ID:pafik13,项目名称:pharm-merch-tablet,代码行数:17,代码来源:MainFragment+-+копия+(2).cs

示例4: OnOptionsItemSelected

        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            mDrawerToggle.OnOptionsItemSelected (item);
            if (item.ItemId == Resource.Id.action_search) {
                RelativeLayout layout = FindViewById<RelativeLayout> (Resource.Id.layout_search);

                if (layout.Visibility == ViewStates.Gone) {
                    item.SetIcon (Resource.Drawable.ic_close);
                    layout.Visibility = ViewStates.Visible;
                    layout.Alpha = 0.0f;
                    layout.Animate ().TranslationY (0).Alpha (1.0f);
                } else {
                    item.SetIcon (Resource.Drawable.ic_search_white);
                    layout.Visibility = ViewStates.Gone;
                    InputMethodManager imm = (InputMethodManager)GetSystemService (Context.InputMethodService);
                    imm.HideSoftInputFromWindow (mSearchBox.WindowToken, 0);
                }
            }
            return base.OnOptionsItemSelected (item);
        }
开发者ID:JackNguyen-Developer,项目名称:TroLySo_YTe,代码行数:20,代码来源:MainActivity.cs


注:本文中的IMenuItem.SetIcon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。