图层颜色渐变-CAGradientLayer

- (void)customLayer

{

CAGradientLayer*layer = [CAGradientLayerlayer];

layer.frame=CGRectMake(0,0, [UIScreenmainScreen].bounds.size.width,200);

[self.view.layeraddSublayer:layer];

layer.colors=@[(__bridgeid)[[UIColorblackColor]colorWithAlphaComponent:0.8].CGColor,

(__bridgeid)[UIColorclearColor].CGColor,

];

[layersetStartPoint:CGPointMake(0.5,0)];

[layersetEndPoint:CGPointMake(0.5,1)];

}

你可能感兴趣的:(图层颜色渐变-CAGradientLayer)