diff --git a/SDPhotoBrowser/SDPhotoBrowser/SDWaitingView.h b/SDPhotoBrowser/SDPhotoBrowser/SDWaitingView.h index d688e1e..090bbde 100755 --- a/SDPhotoBrowser/SDPhotoBrowser/SDWaitingView.h +++ b/SDPhotoBrowser/SDPhotoBrowser/SDWaitingView.h @@ -13,5 +13,6 @@ @property (nonatomic, assign) CGFloat progress; @property (nonatomic, assign) int mode; +@property (nonatomic, assign) CGFloat lineWidth; @end diff --git a/SDPhotoBrowser/SDPhotoBrowser/SDWaitingView.m b/SDPhotoBrowser/SDPhotoBrowser/SDWaitingView.m index ca8ae36..ba4cfa2 100755 --- a/SDPhotoBrowser/SDPhotoBrowser/SDWaitingView.m +++ b/SDPhotoBrowser/SDPhotoBrowser/SDWaitingView.m @@ -79,10 +79,11 @@ - (void)drawRect:(CGRect)rect default: { - CGContextSetLineWidth(ctx, 15); + CGFloat width = self.lineWidth ? self.lineWidth : 15; + CGContextSetLineWidth(ctx, width); CGContextSetLineCap(ctx, kCGLineCapRound); CGFloat to = - M_PI * 0.5 + self.progress * M_PI * 2 + 0.05; // 初始值0.05 - CGFloat radius = MIN(rect.size.width, rect.size.height) * 0.5 - SDWaitingViewItemMargin; + CGFloat radius = MIN(rect.size.width, rect.size.height) * 0.5 - width / 2; CGContextAddArc(ctx, xCenter, yCenter, radius, - M_PI * 0.5, to, 0); CGContextStrokePath(ctx); }