2017-01-25 2 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- top-right-corner-of-a-uiview –

+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; 
Смежные вопросы