LoginSignup
0
0

More than 3 years have passed since last update.

Gradients on UIView

Last updated at Posted at 2020-11-24
#import <QuartzCore/QuartzCore.h>

CAGradientLayer *gradient = [CAGradientLayer layer];
    gradient.frame = self.view.frame;
    gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor colorWithRed:(112/255.0) green:(119/255.0) blue:(126/255.0) alpha:1] CGColor], (id)[[UIColor colorWithRed:(73/255.0) green:(81/255.0) blue:(90/255.0) alpha:1] CGColor], nil];
    [self.view.layer insertSublayer:gradient atIndex:0];

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0