iOS view添加背景色

//背景渐变

CAGradientLayer *gradient = [CAGradientLayer layer];

gradient.frame = CGRectMake(0, 0, headerView.frame.size.width, headerView.frame.size.height);

gradient.colors = [NSArray arrayWithObjects:

(id)Color_4690fa.CGColor,

(id)Color_0069fe.CGColor,

nil];

[headerView.layer insertSublayer:gradient atIndex:0];

你可能感兴趣的:(iOS view添加背景色)