所以,我这样做是为了通过一系列的颜色 来动画一个iOS 应用程序:
[UIView animateWithDuration:3.0 animations:^{
gradient = CGGradientCreateWithColorComponents(colorSpace, colors, locations, number_of_locations);
CGContextDrawRadialGradient(context, gradient, start, 0, end, sqrt((self.frame.size.width*self.frame.size.width)+(self.frame.size.height*self.frame.size.height)), kCGGradientDrawsBeforeStartLocation);
}];
It works, for the most part. Each time I change a color it flickers with a completely opposite color. For example, when it s about to turn orange from red, it flickers with green. Community, how fix? :D
谢谢