UIView* signBg = [[UIView alloc]init];
// signBg.backgroundColor = [UIColor grayColor];
signBg.frame = CGRectMake(0, kListHeight - kSignBgHeight, kPresentersImageHegiht, kSignBgHeight);
[bgView addSubview:signBg];
//开始颜色,透明度
UIColor *colorOne = [UIColor colorWithRed:(0.0) green:(0.0) blue:(0.0) alpha:0.0];
//结束颜色,透明度
UIColor *colorTwo = [UIColor colorWithRed:(0.0) green:(0.0) blue:(0.0) alpha:0.4];
NSArray *colors = [NSArray arrayWithObjects:(id)colorOne.CGColor, colorTwo.CGColor, nil];
//crate gradient layer
CAGradientLayer *headerLayer = [CAGradientLayer layer];
headerLayer.frame = CGRectMake(0, 0, kPresentersImageHegiht, kSignBgHeight);
headerLayer.colors = colors;
//根据颜色值数组,设置颜色开始渐变的位置,如果是x轴渐变,最左边0.0,最右边是1,中间是介于0和1之前。
headerLayer.locations = @[@(0.0),@(1.0)];
//左上角(0,) 右下角(1,1)
headerLayer.startPoint = CGPointMake(0, 0);
headerLayer.endPoint = CGPointMake(0, 1);
[signBg.layer addSublayer:headerLayer];