CGPoint position= CGPointMake(_blueView.center.x, _blueView.center.y);//阴影中心点
CGFloat borderWidth = 2;
//阴影图层
CALayer *layerShadow=[[CALayer alloc]init];
layerShadow.bounds = _blueView.bounds;
layerShadow.position = position;
layerShadow.shadowColor = [UIColor grayColor].CGColor;
layerShadow.shadowOffset = CGSizeMake(2, 1);
layerShadow.shadowOpacity = 1;
layerShadow.borderColor = [UIColor whiteColor].CGColor;
layerShadow.borderWidth = borderWidth;
[self.view.layer addSublayer:layerShadow];
网友评论