Skip to content

haogaoming123/Button-Animation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Button-Animation

按钮的渐变色效果

先看效果:

主要代码:

@implementation UIButton (Animation)
/**
 添加渐变色特效
 */
-(void)addGradientButton
{
    CAGradientLayer *layer = [CAGradientLayer layer];
    layer.colors = @[(__bridge id)buleColor.CGColor,(__bridge id)purpleColor.CGColor];
    layer.startPoint = CGPointMake(0, 0);
    layer.endPoint = CGPointMake(1.0, 0);
    layer.frame = self.bounds;
    [self.layer addSublayer:layer];
}

About

按钮的渐变色效果

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published