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


C# UIToolbar.RemoveFromSuperview方法代码示例

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


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

示例1: ViewDidLoad

		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			
			// Perform any additional setup after loading the view, typically from a nib.
			this.NavigationController.NavigationBarHidden = true;

			//UIPickerView--------------------------------------------------------------

			//model for data loading
			PickerModel model = new PickerModel(this.View);

			//picker
			UIPickerView picker = new UIPickerView();
			picker.Frame = new RectangleF(0,164,768,216);

			picker.ShowSelectionIndicator = true;
			picker.Model = model;

			//--------------------------------------------------------------------------

			//Setup the toolbar
			UIToolbar toolbar = new UIToolbar();
			toolbar.Frame = new RectangleF(0,380,768,44);
			toolbar.BarStyle = UIBarStyle.Black;
			toolbar.Translucent = true;
			toolbar.SizeToFit();

			
			//Create a 'done' button for the toolbar and add it to the toolbar
			UIBarButtonItem doneButton = 
				new UIBarButtonItem
					("Done",UIBarButtonItemStyle.Done,
					 (s,e) => 
					 {
						//do something after the values is selected
//						this.txtCurrentAltitude.ResignFirstResponder();
						picker.RemoveFromSuperview();
						toolbar.RemoveFromSuperview();
					}
					);

			UIBarButtonItem loadButton = 
				new UIBarButtonItem
					("Load",UIBarButtonItemStyle.Bordered,
					 (s,e) => 
					 {
						//do something after the values is selected
					}
					);

			toolbar.SetItems(new UIBarButtonItem[]{doneButton,loadButton},true);

	

			btnLoadPicker.TouchUpInside += (object sender, EventArgs e) => 
			{
				this.View.AddSubview(picker);
				this.View.AddSubview(toolbar);
			};
			//UIPickerView--------------------------------------------------------------

			//DialogView----------------------------------------------------------------
			FPLView.BackgroundColor = new UIColor(0.89f,0.78f,0.56f,1.00f);
			ListBoxDialog lbd = new ListBoxDialog();
			MTDView.AddSubview(lbd.View);

			btnFPLLoad.BackgroundColor = new UIColor(0.78f,0.65f,0.39f,1.00f);
			//COLOR ON PRESS
//			btnFPLLoad.TintColor = new UIColor(0.78f,0.65f,0.39f,1.00f);


			btnFPLCancel.BackgroundColor = new UIColor(0.78f,0.65f,0.39f,1.00f);

			btnFPLCancel.TouchUpInside += (object sender, EventArgs e) => 
			{
				FPLView.RemoveFromSuperview();
			};
			btnDialog.TouchUpInside += (object sender, EventArgs e) => 
			{
				this.View.AddSubview(FPLView);
			};

		}
开发者ID:moljac,项目名称:MonoMobile.Dialog,代码行数:84,代码来源:ListBoxView.cs


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