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];
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/3330.html