//
// ViewController.m
// test_CAGradientLayer
//
// Created by admin on 3/4/16.
// Copyright © 2016 jeffasd. All rights reserved.
//
#import "ViewController.h"
#import "GardView.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
GardView *view = [[GardView alloc] initWithFrame:CGRectMake(100, 300, 500, 50)];
// view.frame = CGRectMake(100, 30, 50, 50);
[self.view addSubview:view];
[view setProgress:0.6];
[view performAnimation];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
//
// GardView.h
// test_CAGradientLayer
//
// Created by admin on 3/4/16.
// Copyright © 2016 jeffasd. All rights reserved.
//
#import
@interface GardView : UIView
- (void)setProgress:(CGFloat)value;
- (void)performAnimation;
@end
//
// GardView.m
// test_CAGradientLayer
//
// Created by admin on 3/4/16.
// Copyright © 2016 jeffasd. All rights reserved.
//
#import "GardView.h"
@interface GardView()
@property (nonatomic, strong) CALayer *maskLayer;
@property (nonatomic, assign) CGFloat progress;
@end
@implementation GardView
+ (Class)layerClass {
return [CAGradientLayer class];
}
Use a horizontal gradient
//CAGradientLayer *layer = (id)[self layer];
//[layer setStartPoint:CGPointMake(0.0, 0.5)];
//[layer setEndPoint:CGPointMake(1.0, 0.5)];
//
Create colors using hues in +5 increments
//NSMutableArray *colors = [NSMutableArray array];
//for (NSInteger hue = 0; hue
参考文章:
http://www.cocoachina.com/industry/20140705/9039.html
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
作者:京东科技 周新智 一、引言 近日,IoT 研发团队加入了不少新同学,对 git 分支的命名和管理方式有些许的模糊,分支的命名规范以及管理方式对项目的版本发布至关重要,为了解决实际开发过程中版本发布时代码管理混乱、冲突等比较头疼的问题,我们将在文中阐述如何…