CAGradientLayer *gradientLayer = [CAGradientLayer layer]; gradientLayer.colors = @[(__bridge id)[UIColor cyanColor].CGColor, (__bridge id)[UIColor blueColor].CGColor]; gradientLayer.locations = @[@(0), @(2)]; gradientLayer.startPoint = CGPointMake(0, 0); gradientLayer.endPoint = CGPointMake(0, 1); gradientLayer.frame = CGRectMake(0, -44, [UIScreen mainScreen].bounds.size.width, 88); [nvc.navigationBar.layer addSublayer:gradientLayer];
navigation设置渐变色
最新推荐文章于 2023-09-07 10:34:02 发布