Authored by 阿达

fix bug

@@ -91,9 +91,12 @@ @@ -91,9 +91,12 @@
91 - (void)setProgress:(float)progress animated:(BOOL)animated 91 - (void)setProgress:(float)progress animated:(BOOL)animated
92 { 92 {
93 BOOL isGrowing = progress > 0.f; 93 BOOL isGrowing = progress > 0.f;
94 - UIImageView * maskImageView =[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"Mask"]];  
95 - self.progressBarView.maskView = maskImageView;  
96 - 94 + UIImageView * maskImageView =[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.progressBarView.frame), CGRectGetHeight(self.progressBarView.frame))];
  95 + CALayer *layer = [CALayer layer];
  96 + [layer setFrame:CGRectMake(0, 0, CGRectGetWidth(self.progressBarView.frame), CGRectGetHeight(self.progressBarView.frame))];
  97 + [layer setContents:(id)[UIImage imageNamed:@"Mask"].CGImage];
  98 +// self.progressBarView.maskView = maskImageView;
  99 + [self.progressBarView addSubview:maskImageView];
97 100
98 CGFloat originX = -CGRectGetWidth(self.bounds)/2; 101 CGFloat originX = -CGRectGetWidth(self.bounds)/2;
99 CGPoint positionBegin = CGPointMake(originX+_progress * self.bounds.size.width, CGRectGetHeight(self.progressBarView.frame)/2); 102 CGPoint positionBegin = CGPointMake(originX+_progress * self.bounds.size.width, CGRectGetHeight(self.progressBarView.frame)/2);