//调用渲染
[self.view.layer addSublayer:[self shadowLayer]];
- (CAGradientLayer *)shadowLayer
{
CAGradientLayer *newShadow = [[CAGradientLayer alloc] init] ;
newShadow.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
//添加渐变的颜色组合
newShadow.colors = [NSArray arrayWithObjects:(id)[UIColor redColor].CGColor,(id)[UIColor greenColor].CGColor,(id)[UIColor magentaColor].CGColor,(id)[UIColor yellowColor].CGColor,(id)[UIColor blueColor].CGColor,(id)[UIColor orangeColor].CGColor,nil];
return newShadow;
}