本文整理汇总了C#中UISegmentedControl.SizeToFit方法的典型用法代码示例。如果您正苦于以下问题:C# UISegmentedControl.SizeToFit方法的具体用法?C# UISegmentedControl.SizeToFit怎么用?C# UISegmentedControl.SizeToFit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UISegmentedControl
的用法示例。
在下文中一共展示了UISegmentedControl.SizeToFit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadView
public override void LoadView()
{
base.LoadView ();
View.BackgroundColor = UIColor.White;
int spacing = GridViewConstants.IsIphone ? 10 : 15;
GridView aGridView = new GridView(View.Bounds);
aGridView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
aGridView.BackgroundColor = UIColor.Clear;
demoGridView = aGridView;
View.AddSubview(demoGridView);
demoGridView.Style = GridViewStyle.Swap;
demoGridView.ItemSpacing = spacing;
demoGridView.MinEdgeInsets = new UIEdgeInsets(spacing, spacing, spacing, spacing);
demoGridView.CenterGrid = true;
demoGridView.ActionDelegate = this;
demoGridView.SortingDelegate = this;
demoGridView.TransformDelegate = this;
demoGridView.DataSource = this;
UIButton infoButton = new UIButton(UIButtonType.InfoDark);
infoButton.Frame = new RectangleF(View.Bounds.Size.Width - 40,
View.Bounds.Size.Height - 40,
40,
40);
infoButton.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleTopMargin;
infoButton.AddTarget(this,new Selector("presentInfo"),UIControlEvent.TouchUpInside);
View.AddSubview(infoButton);
UISegmentedControl dataSegmentedControl = new UISegmentedControl(new String[]{"DataSet 1","DataSet 2"});
dataSegmentedControl.SizeToFit();
dataSegmentedControl.Frame = new RectangleF(5,
View.Bounds.Size.Height - dataSegmentedControl.Bounds.Size.Height - 5,
dataSegmentedControl.Bounds.Size.Width,
dataSegmentedControl.Bounds.Size.Height);
dataSegmentedControl.AutoresizingMask = UIViewAutoresizing.FlexibleRightMargin | UIViewAutoresizing.FlexibleTopMargin;
dataSegmentedControl.TintColor = UIColor.Green;
dataSegmentedControl.SelectedSegment = 0;
dataSegmentedControl.AddTarget(this,new Selector("dataSetChange:"),UIControlEvent.ValueChanged);
View.AddSubview(dataSegmentedControl);
/*
OptionsViewController *optionsController = [[OptionsViewController alloc] init];
optionsController.gridView = gmGridView;
optionsController.contentSizeForViewInPopover = CGSizeMake(400, 500);
_optionsNav = [[UINavigationController alloc] initWithRootViewController:optionsController];
if (INTERFACE_IS_PHONE)
{
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:self action:@selector(optionsDoneAction)];
optionsController.navigationItem.rightBarButtonItem = doneButton;
}*/
}