1个回答
展开全部
用CAGradientLayer类来实现
CAGradientLayer *itemChartLayer = [CAGradientLayer layer];
itemChartLayer.colors = @[(__bridge id)startColor.CGColor,
(__bridge id)endColor.CGColor];
itemChartLayer.startPoint = CGPointMake(0, 0);
itemChartLayer.endPoint = CGPointMake(0, 1);
startpoint和endPoint是颜色分割点
CAGradientLayer *itemChartLayer = [CAGradientLayer layer];
itemChartLayer.colors = @[(__bridge id)startColor.CGColor,
(__bridge id)endColor.CGColor];
itemChartLayer.startPoint = CGPointMake(0, 0);
itemChartLayer.endPoint = CGPointMake(0, 1);
startpoint和endPoint是颜色分割点
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询