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


C# UIPickerView.SizeThatFits方法代码示例

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


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

示例1: CreateCustomPicker

 public void CreateCustomPicker()
 {
     customPickerView = new UIPickerView (RectangleF.Empty) {
         AutoresizingMask = UIViewAutoresizing.FlexibleWidth,
         Model = new CustomPickerModel (),
         ShowSelectionIndicator = true,
         Hidden = true
     };
     customPickerView.Frame = PickerFrameWithSize (customPickerView.SizeThatFits (SizeF.Empty));
     View.AddSubview (customPickerView);
 }
开发者ID:CVertex,项目名称:monotouch-samples,代码行数:11,代码来源:PickerViewController.xib.cs

示例2: Selected

 public override void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path)
 {
     model = new CounterPickerDataModel(model.Counter);
     var vc = new MyViewController (this) {
         Autorotate = dvc.Autorotate
     };
     counterPicker = CreatePicker ();
     counterPicker.Frame = PickerFrameWithSize (counterPicker.SizeThatFits (SizeF.Empty));
     counterPicker.Model = model;
     for (int d = 0; d < model.Items.Count; d++) {
         counterPicker.Select(model.SelectedIndex[d], d, true);
     }
     vc.View.BackgroundColor = UIColor.Black;
     vc.View.AddSubview (counterPicker);
     dvc.ActivateController (vc);
 }
开发者ID:austinvernsonger,项目名称:monotouch-element-pack,代码行数:16,代码来源:CounterElement.cs

示例3: Selected

        public override void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path)
        {
            model = new TimePickerDataModel(model.Time);
            var vc = new MyViewController (this) {
                Autorotate = dvc.Autorotate
            };
            counterPicker = CreatePicker ();
            counterPicker.Frame = PickerFrameWithSize (counterPicker.SizeThatFits (SizeF.Empty));
            counterPicker.Model = model;
            for (int d = 0; d < model.Times.Count; d++) {
                counterPicker.Select(model.SelectedIndex[d], d, true);
            }

            // pass value changed
            model.ValueChanged += delegate {
                if (this.ValueChanged != null) {
                    Value = model.FormatValue ();

                    this.ValueChanged (this, new EventArgs ());
                }
            };

            vc.View.BackgroundColor = backgroundColor;
            vc.View.AddSubview (counterPicker);
            dvc.ActivateController (vc);
        }
开发者ID:dan-pennyfarthingapps,项目名称:PennyFarElements,代码行数:26,代码来源:TimeWithSecondsPickerElement.cs

示例4: CreatePicker

 void CreatePicker()
 {
     //
     // Empty is used, since UIPickerViews have auto-sizing,
     // all that is required is the origin
     //
     myPickerView = new UIPickerView (RectangleF.Empty){
         AutoresizingMask = UIViewAutoresizing.FlexibleWidth,
         ShowSelectionIndicator = true,
         Model = new PeopleModel (this),
         Hidden = true
     };
     // Now update it:
     myPickerView.Frame = PickerFrameWithSize (myPickerView.SizeThatFits (SizeF.Empty));
     View.AddSubview (myPickerView);
 }
开发者ID:CVertex,项目名称:monotouch-samples,代码行数:16,代码来源:PickerViewController.xib.cs

示例5: Selected

		public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path)
		{
			var vc = new MyViewController (this) {
				Autorotate = dvc.Autorotate
			};
			
			fractionPicker = CreatePicker();
			fractionPicker.Frame = PickerFrameWithSize(fractionPicker.SizeThatFits(SizeF.Empty));
			                            
			vc.View.BackgroundColor = UIColor.Black;
			vc.View.AddSubview (fractionPicker);
			dvc.ActivateController (vc);
		}
开发者ID:SuperYeti,项目名称:MonoTouch.Dialog.Extensions,代码行数:13,代码来源:InchFractionElement.cs


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