如何设置进度视图的一侧角半径。
请查找结果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;
非常感谢您的反馈! 提前谢谢。
答案 0 :(得分: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;