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