How to give different (Mixing of = Gradient colours)colours to View...
@property (weak, nonatomic) IBOutlet UIView *navBgView;
CAGradientLayer *gradientMask = [CAGradientLayer layer];
gradientMask.frame = CGRectMake(0, 0, self.view.frame.size.width, 150);
gradientMask.startPoint = CGPointMake(0.0, 0.5); // start at left middle
gradientMask.endPoint = CGPointMake(1.0, 0.5); // end at right middle
gradientMask.colors = @[(id)[UIColor colorWithRed:91/255.0 green:232/255.0 blue:200/255.0 alpha:0.7].CGColor,
(id)[UIColor colorWithRed:91/255.0 green:232/255.0 blue:200/255.0 alpha:0.7].CGColor,
(id)[UIColor colorWithRed:91/255.0 green:232/255.0 blue:200/255.0 alpha:0.5].CGColor,
(id)[UIColor colorWithRed:85/255.0 green:188/255.0 blue:222/255.0 alpha:0.5].CGColor,
(id)[UIColor colorWithRed:85/255.0 green:188/255.0 blue:222/255.0 alpha:0.7].CGColor,
(id)[UIColor colorWithRed:85/255.0 green:188/255.0 blue:222/255.0 alpha:0.7].CGColor];
gradientMask.locations = @[@0.0, @0.10, @0.40, @0.80, @0.90, @1.0];
[_navBgView.layer insertSublayer:gradientMask atIndex:0];
No comments:
Post a Comment