Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin.iOS掩模层_Xamarin_Xamarin.ios - Fatal编程技术网

Xamarin.iOS掩模层

Xamarin.iOS掩模层,xamarin,xamarin.ios,Xamarin,Xamarin.ios,我想从图像上剪下四分之一个圆。我用UIBezirPath和CAshapeLAyer来做。 但它不起作用 这是我的密码 UIBezierPath路径=新的UIBezierPath(); nfloat startAngle=0; nfloat端角=90; n浮动半径=(浮动)(尺寸高度/2); CGPoint中心=新CGPoint(size.Width/2,size.Height/2); 路径。移动到(中心); 添加弧(中心、半径、星形、端角、真); path.AddLineTo(中间); Clos

我想从图像上剪下四分之一个圆。我用UIBezirPath和CAshapeLAyer来做。 但它不起作用 这是我的密码

UIBezierPath路径=新的UIBezierPath();
nfloat startAngle=0;
nfloat端角=90;
n浮动半径=(浮动)(尺寸高度/2);
CGPoint中心=新CGPoint(size.Width/2,size.Height/2);
路径。移动到(中心);
添加弧(中心、半径、星形、端角、真);
path.AddLineTo(中间);
ClosePath();
CAShapeLayer maskLayer=新的CAShapeLayer();
CGRect CGRect=新的CGRect(0,0,size.Width,size.Height);
Frame=imageHolder.Bounds;
maskLayer.Path=Path.CGPath;
maskLayer.BackgroundColor=UIColor.Brown.CGColor;
maskLayer.FillColor=UIColor.Cyan.CGColor;
imageHolder.Layer.Mask=maskLayer;
imageHolder.Layer.MasksToBounds=true;
imageHolder.clipstobunds=true;
我不知道为什么它不起作用。
它只显示原始图像视图。

定义“不工作”。它没用吗?或者它做了什么,但不是你想要的?它是否崩溃或发出错误消息?应用程序正在运行,但我看到了原始图像。图像中没有代码段。定义“不工作”。它没用吗?或者它做了什么,但不是你想要的?它是否崩溃或发出错误消息?应用程序正在运行,但我看到了原始图像。没有来自图像的片段。