Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.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
Iphone UIview中的快照未显示圆弧和圆角_Iphone_Ios_Uibezierpath_Quartz Core - Fatal编程技术网

Iphone UIview中的快照未显示圆弧和圆角

Iphone UIview中的快照未显示圆弧和圆角,iphone,ios,uibezierpath,quartz-core,Iphone,Ios,Uibezierpath,Quartz Core,我正在通过UIBezierPath在uiview上创建圆弧。它做得很好,但当我为共享此uiview拍摄快照时,圆弧不会显示在快照中。uiview显示为默认值,而圆弧和圆角不显示。下面是快照的代码 CGSize sz=CGSizeMake(bottomview.frame.size.width,bottomview.frame.size.height) 下面是生成圆弧的代码 UIBezierPath*aPathbottom=[UIBezierPath-bezierPath] [aPathbotto

我正在通过UIBezierPath在uiview上创建圆弧。它做得很好,但当我为共享此uiview拍摄快照时,圆弧不会显示在快照中。uiview显示为默认值,而圆弧和圆角不显示。下面是快照的代码 CGSize sz=CGSizeMake(bottomview.frame.size.width,bottomview.frame.size.height)

下面是生成圆弧的代码 UIBezierPath*aPathbottom=[UIBezierPath-bezierPath]

[aPathbottom moveToPoint:CGPointMake(0, 262)];





[aPathbottom addLineToPoint:CGPointMake(0, 15)];
[aPathbottom addLineToPoint:CGPointMake(10, 10)];
[aPathbottom addLineToPoint:CGPointMake(20, 6)];
[aPathbottom addLineToPoint:CGPointMake(40, 3.5)];
[aPathbottom addLineToPoint:CGPointMake(60, 6)];
[aPathbottom addLineToPoint:CGPointMake(70, 10)];
[aPathbottom addLineToPoint:CGPointMake(80,15)];

[aPathbottom addLineToPoint:CGPointMake(80, 250)];
[aPathbottom addLineToPoint:CGPointMake(70, 256)];
[aPathbottom addLineToPoint:CGPointMake(60, 260.5)];
[aPathbottom addLineToPoint:CGPointMake(50, 264)];
[aPathbottom addLineToPoint:CGPointMake(55, 264.5)];
[aPathbottom addLineToPoint:CGPointMake(40, 265)];
[aPathbottom addLineToPoint:CGPointMake(45, 264.5)];
[aPathbottom addLineToPoint:CGPointMake(40, 264)];
[aPathbottom addLineToPoint:CGPointMake(20, 260.5)];
[aPathbottom addLineToPoint:CGPointMake(10, 256)];
[aPathbottom addLineToPoint:CGPointMake(0, 250)];
[aPathbottom closePath];


CAShapeLayer *maskLayerbottom = [CAShapeLayer layer];
maskLayerbottom.frame = bottomview.bounds;
maskLayerbottom.path = aPathbottom.CGPath;


bottomview.layer.mask = maskLayerbottom;
我不知道为什么会这样,有人能帮我吗

问候
chakshu arora

您是否尝试添加此项

[bottomview.layer setMasksToBounds:YES];

我得到了我尝试过的答案
[bottomview.layer addSublayer:maskLayerbottom]位于
bottomview.layer.mask=maskLayerbottom的位置
ui视图中的快照显示圆弧

[bottomview.layer setMasksToBounds:YES];