UILabel text color based on custom linear gradient
问题 So I want to set the text color for a UILabel based on a gradient made in photoshop. I have the rgb values for the gradient, {211,119,95} and {199,86,56}. Is this possible? How can I do it? 回答1: You might want to use one of these customizable labels: FXLabel LEffectLabel THLabel 回答2: Another way if you want to target iOS 6+, with a category to UIColor You create a UIColor from a gradient: + (UIColor*) gradientFromColor:(UIColor*)c1 toColor:(UIColor*)c2 withHeight:(int)height { CGSize size =