设置导航渐变色

CAGradientLayer *gradientLayer = [[CAGradientLayer alloc] init];
gradientLayer.startPoint = CGPointMake(0.0, 0.5);
gradientLayer.endPoint = CGPointMake(1.0, 0.5);
gradientLayer.colors = @[
                         (__bridge id)[UIColor colorWithRed:53.0/255.0 green:239.0/255.0 blue:157.0/255.0 alpha:1.0].CGColor,
                         (__bridge id)[UIColor colorWithRed:99.0/255.0 green:250.0/255.0 blue:242.0/255.0 alpha:1.0].CGColor
                         ];
gradientLayer.frame = self.navigationController.navigationBar.bounds;

你可能感兴趣的:(设置导航渐变色)