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


C# CGRect.Integral方法代码示例

本文整理汇总了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";

		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:54,代码来源:HelpView.cs

示例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 ();
		}
开发者ID:g7steve,项目名称:monotouch-samples,代码行数:9,代码来源:ButtonView.cs


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