本文整理汇总了C#中CGRect.Integral方法的典型用法代码示例。如果您正苦于以下问题:C# CGRect.Integral方法的具体用法?C# CGRect.Integral怎么用?C# CGRect.Integral使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGRect
的用法示例。
在下文中一共展示了CGRect.Integral方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HelpView
public HelpView (CGRect frame): base(frame)
{
BackgroundColor = UIColor.White;
Layer.CornerRadius = 8;
var closeFrame = new CGRect (10, frame.Size.Height - 140, 80, 80);
var closeView = new SymbolMarkView (closeFrame);
closeView.TouchUpInside += async (s, e) => await Hide ();
AddSubview (closeView);
closeView.Symbol = "X";
closeView.AccessibilityLabel = "Close";
var label = new UILabel (new CGRect (0, 20, frame.Size.Width, 40)) {
Font = UIFont.FromName ("HelveticaNeue-Italic", 82),
Text = "NSZombieApocalypse",
BackgroundColor = UIColor.Clear,
TextAlignment = UITextAlignment.Center,
};
label.SizeToFit ();
var labelFrame = label.Frame;
labelFrame.X = (frame.Size.Width - labelFrame.Size.Width) / 2;
label.Frame = labelFrame;
AddSubview (label);
label.AccessibilityTraits = UIAccessibilityTrait.Header;
var nextFrame = new CGRect (frame.Size.Width - 90, frame.Size.Height - 140, 80, 80);
nextButton = new SymbolMarkView (nextFrame);
nextButton.TouchUpInside += (s, e) => NextSlide ();
AddSubview (nextButton);
nextButton.Symbol = "->";
nextButton.AccessibilityLabel = "Next";
float width = (float) frame.Size.Width * 0.6f;
var textViewFrame = new CGRect (
200 + ((frame.Size.Width - 200) - width) / 2,
label.Frame.GetMaxY () + 30,
width,
frame.Size.Height * 0.6f
);
textView = new UITextView (textViewFrame.Integral ());
AddSubview (textView);
textView.Editable = false;
textView.Font = UIFont.FromName ("HelveticaNeue", 36);
textView.Text = NSBundle.MainBundle.LocalizedString ("helpText1", null, "Strings");
var imageView = new UIImageView (UIImage.FromBundle ("smaller-zombie1.png"));
var imageFrame = new CGRect (label.Frame.X - 20, textViewFrame.Y, imageView.Frame.Width, imageView.Frame.Height);
imageView.Frame = imageFrame;
AddSubview (imageView);
imageView.IsAccessibilityElement = true;
imageView.AccessibilityLabel = "Poorly drawn, yet oddly menancing, zombie";
}
示例2: LayoutSubviews
public override void LayoutSubviews ()
{
CGRect frame = Bounds;
var newFrame = new CGRect (Bounds.X, frame.Size.Height - 20, Bounds.Width, 20);
labelView.Frame = newFrame.Integral ();
CGRect imageFrame = imageView.Frame;
imageFrame.X = (newFrame.Size.Width - imageFrame.Size.Width) / 2;
imageView.Frame = imageFrame.Integral ();
}