GradientColor
GradientColor copied to clipboard
彻底解决导航栏渐变色
CGSize size = CGSizeMake(376.0f, 83.0f); UIColor *topleftColor = [UIColor colorWithRed:148/255.0f green:127/255.0f blue:202/255.0f alpha:1.0f]; UIColor *bottomrightColor = [UIColor colorWithRed:(141/255.0) green:(137/255.0) blue:(244/255.0) alpha:(1)]; UIImage *bgImg = [UIImage gradientColorImageFromColors:@[topleftColor, bottomrightColor] gradientType:1 imgSize:size];
[UIColor colorWithPatternImage:bgImg]