首先在一个view上扣出一个区域,显示下层view的方法
UIView *v1 = [[UIViewalloc]initWithFrame:self.view.bounds];
[v1 setBackgroundColor:[UIColorblackColor]];
[v1setAlpha:0.8f];
[self.viewaddSubview:v1];
//通过贝赛尔曲线来切出这个口
UIBezierPath *path = [UIBezierPathbezierPathWithRect:CGRectMake(0,0,self.pageSize.width,self.pageSize.height)];
[path appendPath:[[UIBezierPathbezierPathWithRoundedRect:self.rectangleRectcornerRadius:1]bezierPathByReversingPath ]];
CAShapeLayer *shapeLayer = [CAShapeLayerlayer];
shapeLayer.path = path.CGPath;
[v1.layersetMask:shapeLayer];
注:这段代码实现了当中的框。其他请先无视。