本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}