Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
How to set up UIGradientView
UIGradientView * gradientView = (UIGradientView *)self.view;
// Add a radial gradient overlay.
[gradientView addGradientOverlay:[[RadialGradientOverlay alloc] initWithGradientStops:[[NSArray alloc] initWithObjects:
[[GradientStop alloc] initWithColor:[UIColor greenColor] AndOffset:0],
[[GradientStop alloc] initWithColor:[UIColor yellowColor] AndOffset:100],
nil]]];
// Add a linear gradient overlay.
[gradientView addGradientOverlay:[[LinearGradientOverlay alloc] initWithGradientStops:[[NSArray alloc] initWithObjects:
[[GradientStop alloc] initWithColor:[UIColor colorWithRed:0.117f green:0.341f blue:0.6f alpha:1.0f] AndOffset:0],
[[GradientStop alloc] initWithColor:[UIColor colorWithRed:0.16f green:0.537f blue:0.84f alpha:0.0f] AndOffset:100],
nil]]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment