From 7b02207537d35bfa1714bf8beafc921f717d100a Mon Sep 17 00:00:00 2001 From: 单军华 Date: Wed, 11 Jul 2018 10:47:42 +0800 Subject: [PATCH] 首次上传 --- screendisplay/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZProgressView.m | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 55 insertions(+), 0 deletions(-) diff --git a/screendisplay/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZProgressView.m b/screendisplay/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZProgressView.m new file mode 100644 index 0000000..31a6182 --- /dev/null +++ b/screendisplay/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZProgressView.m @@ -0,0 +1,55 @@ +// +// TZProgressView.m +// TZImagePickerController +// +// Created by ttouch on 2016/12/6. +// Copyright �� 2016��� ������. All rights reserved. +// + +#import "TZProgressView.h" + +@interface TZProgressView () +@property (nonatomic, strong) CAShapeLayer *progressLayer; +@end + +@implementation TZProgressView + +- (instancetype)init { + self = [super init]; + if (self) { + self.backgroundColor = [UIColor clearColor]; + + _progressLayer = [CAShapeLayer layer]; + _progressLayer.fillColor = [[UIColor clearColor] CGColor]; + _progressLayer.strokeColor = [[UIColor whiteColor] CGColor]; + _progressLayer.opacity = 1; + _progressLayer.lineCap = kCALineCapRound; + _progressLayer.lineWidth = 5; + + [_progressLayer setShadowColor:[UIColor blackColor].CGColor]; + [_progressLayer setShadowOffset:CGSizeMake(1, 1)]; + [_progressLayer setShadowOpacity:0.5]; + [_progressLayer setShadowRadius:2]; + } + return self; +} + +- (void)drawRect:(CGRect)rect { + CGPoint center = CGPointMake(rect.size.width / 2, rect.size.height / 2); + CGFloat radius = rect.size.width / 2; + CGFloat startA = - M_PI_2; + CGFloat endA = - M_PI_2 + M_PI * 2 * _progress; + _progressLayer.frame = self.bounds; + UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:center radius:radius startAngle:startA endAngle:endA clockwise:YES]; + _progressLayer.path =[path CGPath]; + + [_progressLayer removeFromSuperlayer]; + [self.layer addSublayer:_progressLayer]; +} + +- (void)setProgress:(double)progress { + _progress = progress; + [self setNeedsDisplay]; +} + +@end -- Gitblit v1.8.0