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


C# UIView.Count方法代码示例

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


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

示例1: CreateLines

		void CreateLines()
		{
			var size = Bounds.Size;
			UIView[] outerLines = new UIView[3];
			var i = 0;
			while(i != outerLines.Count())
			{
				var line = outerLines[i];
				CoreGraphics.CGRect lineFrame;
				switch (i)
				{
					case 0:
					lineFrame = new CoreGraphics.CGRect(0, 0, size.Width, lineWidth);
					break;
					case 1:
						lineFrame = new CoreGraphics.CGRect(size.Width - lineWidth, 0, lineWidth, size.Height);
					break;
					case 2:
						lineFrame = new CoreGraphics.CGRect(0, size.Height - lineWidth, size.Width, lineWidth);
					break;
					case 3:
						lineFrame = new CoreGraphics.CGRect(0, 0, lineWidth, size.Height);
					break;
					default:
						lineFrame = CoreGraphics.CGRect.Empty;
						break;
				}
				line.Frame = lineFrame;
				this.AddSubview(line);
				i++;
			}

			i = 0;

			UIView[] corners = new UIView[3];
			while(i != outerLines.Count())
			{
				var corner = corners[i];
				CoreGraphics.CGRect horizontalFrame = CoreGraphics.CGRect.Empty;
				CoreGraphics.CGRect verticalFrame = CoreGraphics.CGRect.Empty;

				switch (i)
				{
					case 0:
						verticalFrame = new CoreGraphics.CGRect(-cornerDepth, -cornerDepth, cornerDepth, cornerWidth);
						horizontalFrame = new CoreGraphics.CGRect(size.Width + cornerDepth - cornerWidth, -cornerDepth, cornerWidth, cornerDepth);
					break;
					case 1:
						verticalFrame = new CoreGraphics.CGRect(size.Width, -cornerDepth, cornerDepth, cornerWidth);
						horizontalFrame = new CoreGraphics.CGRect(size.Width + cornerDepth- cornerWidth, -cornerDepth, cornerWidth, cornerDepth);
						break;
					case 2:
						verticalFrame = new CoreGraphics.CGRect(-cornerDepth, size.Height + cornerDepth - cornerWidth, cornerDepth, cornerWidth);
						horizontalFrame = new CoreGraphics.CGRect(-cornerDepth, size.Height, cornerWidth, cornerDepth);
					break;
					case 3:
						verticalFrame = new CoreGraphics.CGRect(size.Width, size.Height + cornerDepth - cornerWidth, cornerDepth, cornerWidth);
						horizontalFrame = new CoreGraphics.CGRect(size.Width + cornerDepth - cornerWidth, size.Height, cornerWidth, cornerDepth);
					break;
					defaut:
						verticalFrame = CoreGraphics.CGRect.Empty;
						horizontalFrame = CoreGraphics.CGRect.Empty;
						break;
						
				}

				corners[0].Frame = verticalFrame;
				corners[1].Frame = horizontalFrame;
				i++;
			}

			var lineThickness = lineWidth / UIScreen.MainScreen.Scale;


		}	
开发者ID:MikeCodesDotNet,项目名称:Beer-Drinkin,代码行数:75,代码来源:CropOverlay.cs


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