渐变

作者: 天上掉陷阱 | 来源:发表于2016-10-17 16:44 被阅读7次

    [view.layer addSublayer:[self shadowAsInverse]];

    - (CAGradientLayer *)shadowAsInverse

    {

    CAGradientLayer *newShadow = [[CAGradientLayer alloc] init];

    CGRect newShadowFrame = CGRectMake(0,0, kScreenWidth,70);

    newShadow.frame = newShadowFrame;

    newShadow.colors = [NSArray arrayWithObjects:

    (id)[[UIColor colorWithRed:0x3e/255.0fgreen:0xcb/255.0fblue:1alpha:1.0] CGColor] ,

    (id)[[UIColor colorWithRed:0x30/255.0fgreen:0x77/255.0fblue:1alpha:1.0] CGColor],

    nil];

    return[newShadow autorelease];

    }

    相关文章

      网友评论

          本文标题:渐变

          本文链接:https://www.haomeiwen.com/subject/jiqzyttx.html