2017-01-25 9 views
0

한쪽 코너 반경의 progressview를 설정하는 방법.측면 코너 반경에서 progressview를 만드는 방법

결과 progressView보기를 첨부 파일로 찾으십시오. YLProgressView

다음은 내 ProgressView 코드입니다.

cell.categoryImageView.backgroundColor = [categoryColorArray objectAtIndex:indexPath.row]; 
cell.categoryImageView.image = [UIImage imageNamed:[categoryImageArray objectAtIndex:indexPath.row]]; 

cell.progressView.indicatorTextDisplayMode = MHProgressBarIndicatorTextDisplayModeProgress; 
cell.progressView.type      = MHProgressBarTypeFlat; 
cell.progressView.behavior     = MHProgressBarBehaviorIndeterminate; 
cell.progressView.stripesOrientation  = MHProgressBarStripesOrientationVertical; 

UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:cell.progressView.bounds byRoundingCorners:(UIRectCornerTopRight | UIRectCornerBottomRight) cornerRadii:CGSizeMake(10.0, 10.0)]; 

CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; 
maskLayer.frame = cell.progressView.bounds; 
maskLayer.path = maskPath.CGPath; 
cell.progressView.layer.mask = maskLayer; 

enter image description here

는 귀하의 의견은 매우 감사합니다! 미리 감사드립니다.

+0

http://stackoverflow.com/questions/10167266/how-to-set-cornerradius-for-only-top-left-and- 오른쪽 상단 구석 –

+0

progressView보기 –

답변

0

진행보기위한 코너 반경이 시도 :

UIBezierPath *progressViewPath = [UIBezierPath bezierPathWithRoundedRect:cell.progressView.bounds byRoundingCorners:(UIRectCornerTopRight | UIRectCornerBottomRight) cornerRadii:CGSizeMake(20, 0)]; 
CAShapeLayer *progressViewLayer = [[CAShapeLayer alloc] init]; 
progressViewLayer.frame = self.view.bounds; 
progressViewLayer.path = progressViewPath.CGPath; 
cell.progressView.layer.mask = progressViewLayer;