草庐IT

endColor

全部标签

ios - 创建渐变并返回方法

对于有关iPhone和Quartz编程的菜鸟问题,我们深表歉意。刚刚开始我从C++到Objective-C的转换:)所以,我有这样一个类方法+(CGGradientRef)CreateGradient:(UIColor*)startColorendColor:(UIColor*)endColor{CGGradientRefresult;CGColorSpaceRefcolorSpace=CGColorSpaceCreateDeviceRGB();CGFloatlocations[2]={0.0f,1.0f};CGFloatstartRed,startGreen,startBlue,st