IOS 透明过度层渐变色
CAGradientLayer *gradient = [CAGradientLayer layer]; gradient.frame = CGRectMake(0, 170*RATIO, _barViewTableView.bounds.size.width+50*RATIO, 365*RATIO); gradient.colors = @[(__bridge id)UIColor.clearColor.CGColor, (__bridge id)UIColor.whiteColor.CGColor, (__bridge id)UIColor.whiteColor.CGColor, (__bridge id)UIColor.clearColor.CGColor]; gradient.locations = @[@0,@(1.0/16),@(15.0/16),@1]; self.baseView.layer.mask = gradient; [self.baseView addSubview:_barViewTableView];