- (void)viewDidLoad {
[super viewDidLoad];
UIView*backGroundView =[[UIView alloc] initWithFrame:self.view.bounds];
self.view.backgroundColor=[UIColor grayColor];
backGroundView.backgroundColor=[UIColor whiteColor];
backGroundView.alpha= 0.7;
[self.view addSubview:backGroundView];
UIBezierPath*path =[UIBezierPath bezierPathWithRect:self.view.bounds];//创建一个圆形path
/*UIBezierPath *circlePath = [UIBezierPath bezierPathWithArcCenter:CGPointMake(self.view.center.x, self.view.center.y - 25)
radius:50
startAngle:0
endAngle:2 * M_PI
clockwise:NO];*/
//创建矩形
UIBezierPath *circlePath = [UIBezierPath bezierPathWithRect:CGRectMake(self.view.bounds.size.width / 2 - 100, self.view.bounds.size.height / 2 - 100, 200, 200)];
[path appendPath:circlePath];
CAShapeLayer*shaperLayer =[CAShapeLayer layer];
shaperLayer.path=circlePath.CGPath;
backGroundView.layer.mask= shaperLayer;